Php 5.0.5 and Mysql 5.0.12 failure on accessing database.

From: Date: Sun, 23 Oct 2005 17:36:20 +0000
Subject: Php 5.0.5 and Mysql 5.0.12 failure on accessing database.
Groups: php.db 
Request: Send a blank email to php-db+get-40540@lists.php.net to get a copy of this message
Hi Apologies, I'm a noob so plz bear with me :). In attempting to get TorrertFlux, a php bittorrent manager, working I came across a significant problem: the php content be displayed. After further investigation it became apparent that this was mysql related, so I hacked together a quick script to see what was happening and found the following: When using: @mysql_select_db("sample"), instead of $test = mysql_select_db("sample", &dbConnect) the same problem of the php page not loading would occur. Does anyone have any idea my this is occurring? I'm running Php 5.0.5, Mysql 5.0.12, Apache 1.3.33 on FreeBSD 5.4-Stable. Thanks Blake I've attached a copy of the script for clarity (changed usrname and password :P) <?PHP echo ("<p>Starting database stuff:</p>"); $dbConnect = mysql_connect ("localhost", "abc", "xyz"); if (!$dbConnect) { echo ("<p>Unable to connect to database.</p>"); exit(); } else echo ("<p> Connected </p>"); $test = mysql_select_db("sample", $dbConnect); if (!$test) { echo ("<p>Unable to to select table.</p>"); exit(); } $sql = "SELECT * FROM names"; $result = @mysql_query($sql); while ($row = mysql_fetch_array($result)) { echo ("<p>" . $row["name"] . " - " . $row["age"] . "</p>"); } echo ("<p>Closing database stuff:</p>"); ?>

« previous php.db (#40540) next »