|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ziff Davis Enterprise Virtual Tradeshows: Hot Topics, Cutting Edge Technology, Real-time Interaction with IT Professionals. Learn more at ziffdavisvts.com
|
|
#1
|
|||
|
|||
|
another mySql error...
another error i can't figure out :P help paweese...
and i dont know if it is actually line 17 do to wrapping and such on my post, but it refers to: $result = mysql_query("SELECT * FROM address",$db); if ($myrow = mysql_fetch_array($result)) { ... [error/output] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/essenmin/public_html/matt/ope.php on line 17 Sorry, no records were found! [/end output] [code] <html> <body> <?PHP $db = mysql_connect("localhost", "*****", "******"); mysql_select_db("essemin_myDb",$db); // display individual record if ($id) { $result = mysql_query("SELECT * FROM address WHERE id=$id",$db); $myrow = mysql_fetch_array($result); printf("Name: %s\n<br>", $myrow["name"]); printf("Address: %s\n<br>", $myrow["address"]); printf("Home Number: %s\n<br>", $myrow["hnum"]); printf("Work Number: %s\n<br>", $myrow["wnum"]); } else { // show employee list $result = mysql_query("SELECT * FROM address",$db); if ($myrow = mysql_fetch_array($result)) { // display list if there are records to display do { printf("<a href=\"%s?id=%s\">%s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["name"]); } while ($myrow = mysql_fetch_array($result)); } else { // no records to display echo "Sorry, no records were found!"; } } ?> </body> </html> |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > another mySql error... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|