Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP code not working in IE8
    text
    copied!<p>I've got a baffling IE8 PHP problem. The code below works fine in chrome and FF but not IE8. The form is submitting, errors are displayed if no search term or check-boxes selected, and if both db searches fail the No Actors and No Movies found echo's are both displayed. But if either one of the searches is successful nothing is displayed, not even the Actors/Movies found echo which has me stumped.</p> <p>Here's the code:</p> <pre><code>&lt;?php if($_POST[submitbutton]){ $search = trim(mysql_real_escape_string($_POST[search])); if(!$search){ echo "Please enter a search term!"; }else if(!$_POST['checkbox']){ echo "Please select at least one database to search!"; }else{ //search names if(in_array("actors", $_POST['checkbox'])){ $query = mysql_query("SELECT name_id, realname, mainalias FROM names WHERE realname LIKE '%$search%' OR mainalias LIKE '%$search%'"); if(mysql_num_rows($query)==0){ echo "&lt;h2&gt;No Actors by that name found!&lt;/h2&gt;", "&lt;p&gt;"; }else{ echo "&lt;h2&gt;Actors Found:&lt;/h2&gt;"; while ($record = mysql_fetch_assoc($query)){ $realname = $record['realname']; $name_id = $record['name_id']; echo "&lt;a href='index.php?page=name&amp;id=$name_id'&gt;", $realname, "&lt;/a&gt;&lt;hr&gt;"; } } } //search titles if(in_array("movies", $_POST['checkbox'])){ $query = mysql_query("SELECT title_id, title FROM titles WHERE title LIKE '%$search%'"); if(mysql_num_rows($query)==0){ echo "&lt;h2&gt;No Movies by that name found!&lt;/h2&gt;", "&lt;p&gt;"; }else{ echo "&lt;h2&gt;Movies Found:&lt;/h2&gt;"; while ($record = mysql_fetch_assoc($query)){ $title = $record['title']; $title_id = $record['title_id']; echo "&lt;a href='index.php?page=title&amp;amp;id=$title_id'&gt;", $title, "&lt;/a&gt;&lt;br&gt;"; echo "&lt;hr&gt;"; } } } } } //end post submitbutton ?&gt; </code></pre>
 

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