Jump to content

Problem with SET @var


filnike

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/222378-problem-with-set-var/
Share on other sites

.....

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.

 

 

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 ;)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.