Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Micah Gersten
Jim Lucas wrote: > > I would add a second column to that admin_lastping KEY > > KEY `admin_lastping` (`admin_lastping`, `admin_id`) > > Since you are using both columns in your where clause, they both need to be > specified /in the same/ index for and index to be used. > > Otherwise, some random

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
MySQL may have noticed it was impossible with the current data he had using the index on that field, but in the future it may become valid, so I wouldn't necessary eliminate it if it's deemed crucial. A query that returns no results is equally as useful as one that returns many. I'm not arguin

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Ashley Sheridan
On Thu, 2009-02-05 at 08:48 +1100, Chris wrote: > Ashley Sheridan wrote: > > On Thu, 2009-02-05 at 08:38 +1100, Chris wrote: > >> Jônatas Zechim wrote: > >>> For example i’ve this query: > >>> > >>> > >>> > >>> SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' > >>> AND > >

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
Ashley Sheridan wrote: On Thu, 2009-02-05 at 08:38 +1100, Chris wrote: Jônatas Zechim wrote: For example i’ve this query: SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND admin_lastping >= '1233762608' AND admin_id='1' I ran explain, the result for extra is

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Ashley Sheridan
On Thu, 2009-02-05 at 08:38 +1100, Chris wrote: > Jônatas Zechim wrote: > > For example i’ve this query: > > > > > > > > SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND > > admin_lastping >= '1233762608' AND admin_id='1' > > > > > > > > I ran explain, the result

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
Jônatas Zechim wrote: For example i’ve this query: SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND admin_lastping >= '1233762608' AND admin_id='1' I ran explain, the result for extra is ‘Impossible WHERE noticed after reading const table...’ Well this one i

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jim Lucas
Jônatas Zechim wrote: > Can you dump the table structure to show us how you've set it up? > > Bastien > > Cat, the other other white meat > > > > Yeah, that’s it: > > > > CREATE TABLE `ctalk_admin` ( > > `admin_id` int(9) NOT NULL auto_increment, > > `admin_nome` varchar(50) NOT NU

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jim Lucas
Jônatas Zechim wrote: > For example i’ve this query: > > > > SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND > admin_lastping >= '1233762608' AND admin_id='1' > > > > I ran explain, the result for extra is ‘Impossible WHERE noticed after > reading const table...’