> You really need to re-think your database design if you have to do it
> this way.
>
> ---John Holmes...
>
> > -Original Message-
> > From: César Aracena [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 2:51 PM
> > To: 'PHP DB List
Holmes...
> -Original Message-
> From: César Aracena [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 2:51 PM
> To: 'PHP DB List'; 'PHP General List'
> Subject: RE: [PHP] Querying for MAX
>
> Thanks Natalie & Ed. This Works just fine.
>
what's you're after is
select max(id) from table
-Original Message-
From: David Freeman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 9:36 AM
To: 'PHP General List'
Subject: RE: [PHP] Querying for MAX
> What I'm trying to do here is not insi
> What Im trying to do here is not inside PHP nor MySQL books
> I have. I need to query the DB to look the max result in a
> column. That is, if I have affiliate members with ID going
> from 1 to 10, get the query to know that the last member
> added was 10 so I can add member 11 witho
688
(0299) 446-6621
> -Mensaje original-
> De: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]]
> Enviado el: Miércoles, 12 de Junio de 2002 03:39 p.m.
> Para: 'César Aracena'; 'PHP DB List'; PHP General List
> Asunto: RE: [PHP] Querying for MAX
>
>
is
select MAX()
what you are looking for? I know it works on numeric columns, I'm not sure
if it works on non-numbers, you'd have to look it up in a SQL Tutorial
somewhere.
Good luck!
-Natalie
-Original Message-
From: César Aracena [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12
select MAX(fieldname) from table;
You can also insert data in tables with auto_increment fields to account for
yourneed to insert old member ids.
insert into tablename (ID, Name) values ('$OldID', '$Name');
-Original Message-
From: César Aracena [mailto:[EMAIL PROTECTED]]
Sent: Wednes
7 matches
Mail list logo