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 Link to comment https://forums.phpfreaks.com/topic/37294-solved-problem-regarding-php-520mysql-4119apache-224/ 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(); } ?> Link to comment https://forums.phpfreaks.com/topic/37294-solved-problem-regarding-php-520mysql-4119apache-224/#findComment-178267 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 Link to comment https://forums.phpfreaks.com/topic/37294-solved-problem-regarding-php-520mysql-4119apache-224/#findComment-178292 Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 Table is a reserved word. Change it. Link to comment https://forums.phpfreaks.com/topic/37294-solved-problem-regarding-php-520mysql-4119apache-224/#findComment-178296 Share on other sites More sharing options...
jawaidpk Posted February 6, 2007 Author Share Posted February 6, 2007 Oh my God Link to comment https://forums.phpfreaks.com/topic/37294-solved-problem-regarding-php-520mysql-4119apache-224/#findComment-178305 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. Link to comment https://forums.phpfreaks.com/topic/37294-solved-problem-regarding-php-520mysql-4119apache-224/#findComment-178326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.