I have some php code and heres parts of it:
$user_name = $SESSION['user_name'];
$varnotes = $POST['formnotes'];
$sql_insert = "INSERT into notestable
(user_name,notes) VALUES ('$user_name','$varnotes') ";
I need a php script that allows me to show the last saved 'note' that the specific USER that is signed in has made..
I was able to get it to save the note to the database,
But I am clueless on how to have the LAST SAVED NOTE from THAT USER shown on the page...
I have tried:
//select all fields from the database where user_name is the same as the one stored in the session order by the id in descending order and limit to 1 so only 1 record will be returned
$query = mysql_query("SELECT * FROM notestable WHERE user_name='".mysql_real_escape_string($_SESSION['user_name'])."' ORDER BY id DESC LIMIT 1");
//add record to an object
$row = $mysql_fetch_object($query);
//print out the result
echo $row->notes.' by: '.$row->user_name;
But when i try to use it i get this error:
Fatal error: Function name must be a string in /home/notes.php on line 69
HOW CAN I FIX THIS?? Thanks.