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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.