For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > August 2004 > insert session id to table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author insert session id to table
de Beers

2004-08-18, 3:57 pm

I'm trying to insert a session id to a table but am not sure of the code can
anyone help.

Something like:

$result= MYSQL_QUERY("INSERT INTO cart (cartId)".
"VALUES ('session_id()')");


Ben Gribaudo

2004-08-18, 8:56 pm

Howdy,

Try adding ". and ." around your function call. Also, mysql_query() should
be lower case.

Like: (untested code)
$result=mysql_query("INSERT INTO cart (cartId) VALUES
('".session_id()."')";);
(Of course, you probably need to call mysql_connect() first.)

Hope that helps!

Have a great day!
Ben :-)
Ben Gribaudo - Baltimore, MD - www.bengribaudo.com

"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life."
John 3:16



"de Beers" <fdgdf@yahoo.ca> wrote in message
news:S8NUc.15014$ZI1.701325@news20.bellglobal.com...
> I'm trying to insert a session id to a table but am not sure of the code

can
> anyone help.
>
> Something like:
>
> $result= MYSQL_QUERY("INSERT INTO cart (cartId)".
> "VALUES ('session_id()')");



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com