Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

session variable in sql query

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

session variable in sql query

Postby pugs421 » Sat Jul 05, 2003 7:37 am

I cant figure out the right way to put the session varible into the query. (quotes, parenthesis, etc)



"INSERT INTO setup (photo) VALUES ('$f_org') WHERE screen_name = $_SESSION['screen_name']",
pugs421
New php-forum User
New php-forum User
 
Posts: 31
Joined: Sat Jun 28, 2003 9:09 pm

Postby liquedus » Sat Jul 05, 2003 5:40 pm

"INSERT INTO setup (photo) VALUES ('$f_org') WHERE screen_name = '".$_SESSION['screen_name']."'"

:P
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Postby bezmond » Sun Jul 06, 2003 1:38 am

$screen_name = $_SESSION['screen_name'];
"INSERT INTO setup (photo) VALUES ('$f_org') WHERE screen_name = $screen_name";

would also work :)

Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron