|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-27 19:27 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 04:00:01 2025 UTC |
Whenever I submit the search on the previous page, it goes to this page (as it should), but the code will not execute and I just end up with a blank page. ===================================================== <? // perform search only if a string was entered. { mysql_connect() or die ("Problem connecting to Database"); $query = "select * from pet WHERE pet_species like '$search'"; $result = mysql_db_query("mydb", $query); if ($result) { echo "<table border=1 width=75%>\n"; echo "<tr><td align=center><b>Pet Name</b></td><td align=center><b>Owner Name</b></td><td align=center><b>Pet Type</b></td><td align=center><b>Sex</b></td><td align=center><b>Birth Date</b></td></tr>\n"; do { printf("<tr><td>%s</td><td>%s %s</td><td>%s</td><td align=center>%s</td><td>%s</td></tr>\n", $myrow[pet_name], $myrow[owner_first], $myrow[owner_last],$myrow[pet_species],$myrow[sex],$myrow[pet_birth]); } while ($myrow = mysql_fetch_array($result)); echo "</table>\n"; } else { echo "Sorry, no records were found!"; } ?>