|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
this is the code
<html> <body> <?php $db = mysql_connect("192.168.0.9", ""); mysql_select_db("mydb",$db); $result = mysql_query("SELECT * FROM employees",$db); echo "<table border=1>\n"; echo "<tr><td>Name</td><td>Position</tr>\n"; while ($myrow = mysql_fetch_row($result)) { printf("<tr><td>%s %s</td><td>%s</td></tr>\n", $myrow[1], $myrow[2], $myrow[3]); } echo "</table>\n"; ?> </body> </html> error showing... Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\image\test.php on line 9 |
|
#2
|
|||
|
|||
|
This worked for me:
<html> <body> <?php $db = mysql_connect("localhost", "username", "password"); mysql_select_db("php_testing",$db); $result = mysql_query("SELECT * FROM email",$db); echo "<table border=1>\n"; echo "<tr><td>Name</td><td>Position</tr>\n"; while ($myrow = mysql_fetch_row($result)) { print "<tr><td>%s %s</td><td>%s</td></tr>\n". $myrow[0].", ".$myrow[1].", ".$myrow[2]."<br>"; } echo "</table>\n"; ?> </body> </html> |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > query on phpmysql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|