I am a layperson, please be gentle.
I have a login script that works fairly well. It sets cookies for people that login.
I would like to have that persons datetime field get updated whenever he revisits the site if his cookie is still active.
I added 4 lines of code that should do it, but does not<heavy sigh>... the result is a blank screen, I remove the lines and all is back and OK.
Here is the code.. I added a few lines before and after so you can see the setup...
My problem lines are numbered #1...#4...
Thanks in advance
function displayLogin()
{
global $logged_in;
if($logged_in)
{
//FK----attempt to update datetime field for people that log visits to the site
// $query = "UPDATE users SET datetime=date("Y.m.d - H:i:s"), //Line#1
// WHERE username='$_SESSION[username]'"; //Line#2
// $result = mysql_query($conn, $query) //Line#3
// or die ("could not execute the query."); //Line#4
//FK-----attempt end
echo "<br><h1>Logged In!<br><br></h1>";
echo "Hello <b>$_SESSION[username]</b> you are logged in.<br>
You can see the // where I been tesing to control those lines
(Maybe you can also tell me how to disply the error message rather than just a blank screen)
Any help would be very appreciated.. please be simple in you explanations
Thanks in advance.