ID: 50160 Updated by: j...@php.net Reported By: arrshadowman at msn dot com -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: Windos XP PRO SP3 PHP Version: 5.2.11 New Comment:
Try to var_dump($row); instead to see what it contains, if nothing. And check your error log for any possible errors/warnings/notices. (assuming you have setup PHP properly to put all those in an error log file..) Previous Comments: ------------------------------------------------------------------------ [2009-11-12 17:18:35] arrshadowman at msn dot com Description: ------------ I'm running a developer setup on my PC. PHP 5.211 and MySQL 5.1 with Windows IIS. For some reason I can run direct queries on the MySQL Command Line Client, but using PHP in IE and FireFox, the query does send anything back. It connects to the database, as the ID counter increments everytime I load the page, but the table data returns nothing. Reproduce code: --------------- --- >From manual page: function.mysql-query#Return Values --- $con = mysql_connect("localhost","r...@localhost",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("nsc_db", $con); $result = mysql_query("SELECT * FROM emails", $con); while ($row = mysql_fetch_array($result)); { echo $row['fname']."<BR>".$row['lname']."<BR>".$row['address']."<BR>".$row['age']; } Expected result: ---------------- The full list from table 'emails'. Actual result: -------------- nothing but the <BR> carriage returns. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50160&edit=1