MySQL Forums
Forum List  »  PHP

Re: error
Posted by: Barry Galbraith
Date: November 18, 2012 10:25PM

You need to add the error checking on the mysql_connect() call. That's what's failing.

$feedback = mysql_connect('localhost','user','password') or die(mysql_error());
Your error message is telling you that $feedback in the next line is expected to be of type resource, but it's null. So the mysql_connect() is failing. The error check will tell you why.
mysql_select_db($database_feedback, $feedback)or die(mysql_error());

$query_Recordset1 = "SELECT * FROM homeupdate ORDER BY id DESC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $feedback) or die(mysql_error());  // test for error here too
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
November 17, 2012 06:21PM
November 18, 2012 08:33AM
November 18, 2012 09:47PM
Re: error
November 18, 2012 10:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.