For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > January 2005 > variable scope between php and slq









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 variable scope between php and slq
-

2005-01-31, 3:56 am

i did a 'SET @foobar = 1;' in php but when i do a "SELECT @foobar" in
mysql command line, it returns a null. however, running the select in
php returns a 1. why is that so? is the variable not in scope?
Atlantis

2005-01-31, 3:58 pm

"-" <nobody@hoem.om> wrote in message news:41fda8ae@news.starhub.net.sg...
> i did a 'SET @foobar = 1;' in php but when i do a "SELECT @foobar" in
> mysql command line, it returns a null. however, running the select in
> php returns a 1. why is that so? is the variable not in scope?


What is the exact select statement you are running? Can you show your table
layout and some sample data?


Sponsored Links







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

Copyright 2008 codecomments.com