jawaidpk Posted February 6, 2007 Share Posted February 6, 2007 well whenever I have just install my PHP 5.2.0 but when I tried to execute $dbh = mysql_connect("localhost","root","root") or die("could not open the database"); mysql_select_db("database",$dbh); $res = mysql_query("SELECT * FROM table"); echo mysql_num_rows($res); I saw nothing infact a blank page Remeber I have checked the extension php_mysql.dll in my php.ini file & extension directory settings as well they all are fine infact I also copied libmysql.dll in my C:\windows Quote Link to comment Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 Try... <?php errror_reporting(E_ALL); ini_set('display_errors','1'); $dbh = mysql_connect("localhost","root","root") or die("could not open the database"); mysql_select_db("database",$dbh); if ($res = mysql_query("SELECT * FROM table")) { echo mysql_num_rows($res); } else { echo mysql_error(); } ?> Quote Link to comment Share on other sites More sharing options...
jawaidpk Posted February 6, 2007 Author Share Posted February 6, 2007 well I executed you code & surprisingle I got an error like this You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table' at line 1 Quote Link to comment Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 Table is a reserved word. Change it. Quote Link to comment Share on other sites More sharing options...
jawaidpk Posted February 6, 2007 Author Share Posted February 6, 2007 Oh my God Quote Link to comment Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 I'll assmune that meens your problem is solved and mark the thread acordingly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.