[thelist] mysql - old_password - persistent connection

Jon Molesa rjmolesa at consoltec.net
Tue Nov 18 19:52:02 CST 2008


The reason I ask is that the portion select password('$password') I
think should be select MD5('$password') instead.  Unless Joomla is using
MySql's password hash.  FYI.

*On Tue, Nov 18, 2008 at 05:25:23PM -0700 Bob Meetin <bobm at dottedi.biz> wrote:

> Date: Tue, 18 Nov 2008 17:25:23 -0700
> From: Bob Meetin <bobm at dottedi.biz>
> Subject: Re: [thelist] mysql - old_password - persistent connection
> To: "thelist at lists.evolt.org" <thelist at lists.evolt.org>
> 
> 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?
> >> -- 
> >>     
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 

-- 
Jon Molesa
rjmolesa at consoltec.net
if you're bored or curious
http://rjmolesa.com


More information about the thelist mailing list