[thelist] mysql - old_password - persistent connection

Bob Meetin bobm at dottedi.biz
Tue Nov 18 18:25:23 CST 2008


Jon Molesa wrote:
> Is this related to your previous Joomla username/password question?
>   
Yes - but different twist (old_password) and I am getting through this.  
Really really funny thing happened.  I tried this both repetitively and 
many times (redundantly), various flavors, could not get it to work.  
Then I went to pick up my boy from school and a half hour later tried 
again, now it seems to be working using:

 $q = "select username, password from jos_users where 
username='$username' AND password = (select password('$password'))";

I think I will have a usable program this evening. 

> *On Tue, Nov 18, 2008 at 03:19:04PM -0700 Bob Meetin <bobm at dottedi.biz> wrote:
>
>   
>> Date: Tue, 18 Nov 2008 15:19:04 -0700
>> From: Bob Meetin <bobm at dottedi.biz>
>> Subject: [thelist] mysql - old_password - persistent connection
>> To: "thelist at lists.evolt.org" <thelist at lists.evolt.org>
>>
>> I think I'm running into a problem with persistent connection dropping 
>> losing old_passwords = 'OFF'.  If I run any of the following queries 
>> from within mysql they work fine:
>>
>> 1) mysql> set old_passwords = 'OFF';select * from jos_users where 
>> username = 'some_username';
>> 2) mysql> set old_passwords = 'OFF';select * from jos_users where 
>> username='some_username' AND password=PASSWORD('some_password');
>> 3) mysql> select * from jos_users where username='some_username' AND 
>> password = (select password('some_password'));
>>
>> However when I run them from within PHP, the first is fine, but the 
>> second and third fail:
>>
>> 1) $query = "set old_passwords = 'OFF';select * from jos_users where 
>> username = '$username'";
>> 2) $query = "set old_passwords = 'OFF';select * from jos_users where 
>> username='$username' AND password=PASSWORD('$password')";
>> 3) $query = "set old_passwords = 'OFF';select * from jos_users where 
>> username='$username' AND password = (select password('$password'))";
>>
>>  From the mysql prompt if I run:
>>
>> mysql> set old_passwords = 'OFF';
>> mysql> select * from jos_users where username='some_username' AND 
>> password=PASSWORD('some_password');
>>
>> It works fine, however if I wait 10-15 seconds it fails, indicating that 
>> mysql has lost connection.  Is there another way I can do this to keep 
>> it honest?
>> -- 
>>     



More information about the thelist mailing list