How should I organize my queries to keep a MySQLs variable through multiple queries?
The value of my @varname turns to null between queries.
I LOCK the table
do a couple of queries (with the need of a persistant @varname)
UNLOCK the table
Is this normal MySQL behaivor or am I missing something?
Loosing MySQL variable (@var)
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Loosing MySQL variable (@var)
I'm pretty sure this isn't supported in the PHP extension for MySQL, and it isn't needed. You're using PHP, use PHP vars in the query. If you must have these then you can try using mysqli and your queries in a transaction.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Loosing MySQL variable (@var)
Thanks.
Will have a look on your suggestions.
Will have a look on your suggestions.