Jump to content

[SOLVED] Problem regarding PHP 5.2.0+MySql 4.1.19+Apache 2.2.4


jawaidpk

Recommended Posts

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

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();
  }

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.