Jump to content


Photo

$q = "UPDATE users SET sessionid=".session_id()." WHERE userid=".$_POST['username'];


  • Please log in to reply
1 reply to this topic

#1 reecieboy

reecieboy
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 09 April 2006 - 03:19 PM

Whats wrong with the above?

Problem with query: UPDATE users SET sessionid=27768e4a7b8a093671bf7c4f1e883ed9 WHERE userid=user
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'a7b8a093671bf7c4f1e883ed9 WHERE userid=user' at line 1

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 09 April 2006 - 03:30 PM

You need to surround any text with single quotes:
<?php
$q = "UPDATE users SET sessionid='".session_id()."' WHERE userid='".$_POST['username'] . "'";
?>

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users