logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: problem regarding PHP 5.2.0+ Apache 2.2.4 +MySql4.1.19
Author
jawaidpk



Joined: 06 Feb 2007
Posts: 1

PostPosted: Tue 06 Feb '07 17:12    Post subject: problem regarding PHP 5.2.0+ Apache 2.2.4 +MySql4.1.19 Reply with quote

well I have just installed 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. so what might be the problem??

Remeber I have executed mysqlinfo.php & the output shows the successful connection to mysql something like this.....

User root connected to the MySQL server at localhost

Mysql version: 4.1.19-community-nt
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 06 Feb '07 17:31    Post subject: Reply with quote

Enabled short tags in php.ini?
Back to top
useless81



Joined: 07 Feb 2007
Posts: 6

PostPosted: Fri 09 Feb '07 1:41    Post subject: Reply with quote

mysql_select_db("database");

is all you need there, you can not pass the handle. (I dont anyway),

Try changing your query to SELECT * FROM table WHERE 1

Without the WHERE clause you are returning zero rows I believe.
Back to top


Reply to topic   Topic: problem regarding PHP 5.2.0+ Apache 2.2.4 +MySql4.1.19 View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner