filnike Posted December 22, 2010 Share Posted December 22, 2010 Hi all, first at all, sorry about my english, im from Spain and i write english so badly Im having a problem when i try to set a var in my MySQL Browser. When i write: set @dnr = 3; it's ok, but when i want to get the value of this var: select @dnr; the browser returns me the var, but the value of this var is NULL, and not '3'. This is the problem. ¿Why this is happening? Thanks to all PD. Im using "5.0.51b" version Quote Link to comment https://forums.phpfreaks.com/topic/222378-problem-with-set-var/ Share on other sites More sharing options...
Adam Posted December 22, 2010 Share Posted December 22, 2010 select @var_name; will return null even when the variable doesn't exist (as well as if it were actually null). Can you show the whole code and how it's contained? Quote Link to comment https://forums.phpfreaks.com/topic/222378-problem-with-set-var/#findComment-1150318 Share on other sites More sharing options...
mikosiko Posted December 22, 2010 Share Posted December 22, 2010 ..... Im having a problem when i try to set a var in my MySQL Browser. I'm assuming that you mean 'MYSQL Query Browser'.... in that case probably you opened a 'ResultSet Tab' and wrote your 2 lines of code... right? in that case.... put your cursor in the first line (SET @dnr=3;) and select 'Execute' ... and after that position your cursor in the second line and execute it.... that should work. Quote Link to comment https://forums.phpfreaks.com/topic/222378-problem-with-set-var/#findComment-1150341 Share on other sites More sharing options...
filnike Posted December 23, 2010 Author Share Posted December 23, 2010 Thanks to response i mean 'Mysql Browser', yeah, and this is the code (is also the code wich i wrote in the first post, it's only a test before i'll write the sql case): set @dnr=3; select @dnr; i execute the first line, then the second line, and the result is a column named '@dnr' which value is 'null' but i think is the version of MySQL Administrator, could it be? Thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/222378-problem-with-set-var/#findComment-1150676 Share on other sites More sharing options...
mikosiko Posted December 23, 2010 Share Posted December 23, 2010 Thanks to response i mean 'Mysql Browser'.... set @dnr=3; select @dnr; I did ask for "MYSQL QUERY BROWSER" ... and the code that you posted works on it without any problem. Quote Link to comment https://forums.phpfreaks.com/topic/222378-problem-with-set-var/#findComment-1150848 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.