Syntax to use COOKIE id to update DB field
Posted: Wed Sep 29, 2004 3:43 pm
What is the correct syntax to use a cookie for updating a db field?
I have tried:
In place of '{$_COOKIE['userid']}' I have also tried
Nothing about this particular syntax came up when I searched PHP.net, Google, etc.
Before posting this question I also confirmed that the cookie is being properly sent by overriding automatic cookie handling in my browser so that I could SEE the cookie.
I think I am close with my syntax, so any help will be truly appreciated.
I have tried:
Code: Select all
$query = "INSERT INTO orders (userid, date)
VALUES ('{$_COOKIE['userid']}', '$date')";- '$_COOKIE['userid']'
'$userid'
'{$_POST['userid']}'
Nothing about this particular syntax came up when I searched PHP.net, Google, etc.
Before posting this question I also confirmed that the cookie is being properly sent by overriding automatic cookie handling in my browser so that I could SEE the cookie.
I think I am close with my syntax, so any help will be truly appreciated.