note 83296 deleted from faq.databases by felipe

From: Date: Sat, 24 May 2008 18:46:58 +0000
Subject: note 83296 deleted from faq.databases by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-139704@lists.php.net to get a copy of this message
Note Submitter: termato at termato dot net ---- It connects to the database ok, and it found the database. When I try and retrieve the information though, it gives me the following errors: Database query failed!!!!: It does not give me a mysql_error() I am running this on Apache 2.2.8, PHP 5.2.6 & MySQL 5.0.45 Here is the code i am using: <?php //3. Performing database query $result = mysql_query("SELECT * FROM subjects" , $connection); if(!$results) { die("Database query failed!!!!: " . mysql_error()); } //4. Use returned data while($row = mysql_fetch_array($result)) { echo $row[1]." ".$row[2]."<br />"; } ?> Can anyone help?

« previous php.notes (#139704) next »