PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$titleq = "SELECT title FROM ".TBL_CONT." WHERE id = 125;";
$title = mysql_query($titleq);
$bodyq = "SELECT body FROM ".TBL_CONT." ;";
$body = mysql_query($bodyq);
but when i echo The contents of $body and $title i get this:
Resource id #15
Resource id #16
Witch is not what have in my database:
Welcome! Hello!. Unfortuanatly, We are Still under construc...
What is going wrong?
$titleq = "SELECT title FROM `".TBL_CONT."` WHERE `id` = '125';";
$title = mysql_query($titleq);
$bodyq = "SELECT body FROM `".TBL_CONT."`;";
$body = mysql_query($bodyq);
I have had same here, and doing this has always fixed it for me.
mysql_query() returns a result resource, a hook for MySQL to return records from. Use one of the mysql_fetch_* functions to retrieve the first record it found or a loop calling mysql_fetch_* mutliple times to retrieve all records found.