Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP - MYSQL not selecting in search query
    text
    copied!<p>I am building a mini test php thing. And I need to be able to search the results. This works great. But I cannot seem to make a paging system around this. I sort of know how to make a paging system, however, I cannot seem to do this because the mysql query is not only searching the table records which idedu_details is equal to $edu_details:</p> <pre><code>$search_result = mysql_query("SELECT * FROM test WHERE idedu_details='".$edu_details."' AND first_name LIKE '%".$search."%' OR surname LIKE '%".$search."%'"); </code></pre> <p>here is my complete code:</p> <pre><code>$search_result = mysql_query("SELECT * FROM test WHERE idedu_details='".$edu_details."' AND first_name LIKE '%".$search."%' OR surname LIKE '%".$search."%'"); while($row_search = mysql_fetch_array($search_result)){ $idedu_detail_check = mysql_query("SELECT * FROM test WHERE idtest='".$row_search['idtest']."'") or die(mysql_error()); $row_idedu_check = mysql_fetch_array($idedu_detail_check); if($row_idedu_check['idedu_details'] == $edu_details){ $testid = $row_search['idtest']; $firstName = $row_search['first_name']; $surname = $row_search['surname']; $dob = $row_search['dob']; $date = $row_search['date']; $status = $row_search['status']; $link = "report.php?id=$testid"; $button = '&lt;button onClick="parent.location='. "'".$link."'".'"&gt;Analyse&lt;/button&gt;'; echo "&lt;tr&gt; &lt;td width='100'&gt;$firstName&lt;/td&gt; &lt;td width='100'&gt;$surname&lt;/td&gt; &lt;td width='100'&gt;$dob&lt;/td&gt; &lt;td width='100'&gt;$date&lt;/td&gt; &lt;td width='100'&gt;$status&lt;/td&gt; &lt;td width='100'&gt;$button&lt;/td&gt; &lt;/tr&gt;"; }//end if idedu_detail check }//end while }//end else search != null </code></pre> <p>How can I make a paging system around this? </p> <p>EDIT: I know how to make a general paging system. However, checking the ided_details = $edu_details and building a paging system around this is causing an issue.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload