Whenever I try to echo that it just outputs 'Resource Id #8'. Does anyone know why?
$blurb = mysql_query("SELECT `blurb` FROM `users` WHERE id='" . $_SESSION[user_id] . "'");
Whenever I try to echo that it just outputs 'Resource Id #8'. Does anyone know why?
$blurb = mysql_query("SELECT `blurb` FROM `users` WHERE id='" . $_SESSION[user_id] . "'");
From the manual:
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.
For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.
The returned result resource should be passed to mysql_fetch_array(), and other functions for dealing with result tables, to access the returned data.
mysql_query return a resource. If you want to get result. you should use mysql_fetch_array() or mysql_fetch_row() etc, after mysql_query()
So your code will become
$blurb = mysql_query('your query');
$result = mysql_fetch_array($blurb);
var_dump($result);