Re: [PHP] Getting Newest

2002-11-07 Thread Miles Thompson
; <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]> Cc: "PHP List" <[EMAIL PROTECTED]> Sent: Thursday, November 07, 2002 12:46 PM Subject: Re: [PHP] Getting Newest > > SELECT * FROM table ORDER BY date DESC > > > -- > Maxim Maletsky > [E

Re: [PHP] Getting Newest

2002-11-07 Thread .: B i g D o g :.
Why cant u do a query with some subselects and verify the date from each one or do three queryies for the newest one and then compare them with each other... Should be relatively simple... However, it would be better if the date where a timestamp...MHO On Wed, 2002-11-06 at 21:10, Stephen wro

Re: [PHP] Getting Newest

2002-11-07 Thread Stephen
t;[EMAIL PROTECTED]> Sent: Thursday, November 07, 2002 12:46 PM Subject: Re: [PHP] Getting Newest > > SELECT * FROM table ORDER BY date DESC > > > -- > Maxim Maletsky > [EMAIL PROTECTED] > > > > "Stephen" <[EMAIL PROTECTED]> wrote... : > &

Re: [PHP] Getting Newest

2002-11-07 Thread Maxim Maletsky
"Stephen" <[EMAIL PROTECTED]> > Cc: "PHP List" <[EMAIL PROTECTED]> > Sent: Wednesday, November 06, 2002 4:00 PM > Subject: Re: [PHP] Getting Newest > > > > That depends on what DBMS you are using. Which one is it? > > > > > >

RE: [PHP] Getting Newest

2002-11-06 Thread John W. Holmes
Read my last post and then run SELECT VERSION() in MySQL. I really doubt you're running 4.0. ---John Holmes... > -Original Message- > From: Stephen [mailto:webmaster@;melchior.us] > Sent: Wednesday, November 06, 2002 9:57 PM > To: PHP List > Subject: Re: [PHP] Ge

Re: [PHP] Getting Newest

2002-11-06 Thread Stephen
rom church union "; $sql .= "select * from misc order by date desc limit 1"; - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "'Stephen'" <[EMAIL PROTECTED]>; "'PHP List'" <[EMAIL PROTECTED]>

RE: [PHP] Getting Newest

2002-11-06 Thread John W. Holmes
UNION is implemented in MySQL 4.0.0, btw. > -Original Message- > From: Stephen [mailto:webmaster@;melchior.us] > Sent: Wednesday, November 06, 2002 9:33 PM > To: PHP List > Subject: Re: [PHP] Getting Newest > > So for my SQL statement I put this? > > $sql = &

RE: [PHP] Getting Newest

2002-11-06 Thread John W. Holmes
> $sql = "select id, date, name, text from table1 union"; > $sql2 = "select id, date, name, text from table2 union"; > $sql3 = "select id, date, name, text from table3 order by date desc";> No, it's all one query. $sql = "select id, date, name, text from table1 union " ."select id, date,

Re: [PHP] Getting Newest

2002-11-06 Thread Stephen
ot;Nick Eby" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 7:57 PM Subject: Re: [PHP] Getting Newest > you could make a union of all the records, and order by newest date first: > > (select id, date, name, text from table1) union > (select

Re: [PHP] Getting Newest

2002-11-06 Thread Nick Eby
you could make a union of all the records, and order by newest date first: (select id, date, name, text from table1) union (select id, date, name, text from table2) union (select id, date, name, text from table3) order by date desc then select the first record /nick -- PHP General Mailing Lis

Re: [PHP] Getting Newest

2002-11-06 Thread Stephen
Yes, same columns, everything the same except names and content. - Original Message - From: "1LT John W. Holmes" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 5:31

Re: [PHP] Getting Newest

2002-11-06 Thread 1LT John W. Holmes
Are all three tables the same? Same columns and everything? ---John Holmes... - Original Message - From: "Stephen" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 4:10 PM Subject: [PHP] Getting Newest I have three tables with certain content in

Re: [PHP] Getting Newest

2002-11-06 Thread Marco Tabini
hp on line 17 - Original Message - From: "Marco Tabini" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 4:44 PM Subject: Re: [PHP] Getting Newest > I think you would need to make three queries, since Mysql

Re: [PHP] Getting Newest

2002-11-06 Thread Stephen
- From: "Marco Tabini" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 4:44 PM Subject: Re: [PHP] Getting Newest > I think you would need to make three queries, since Mysql doesn't > suppo

Re: [PHP] Getting Newest

2002-11-06 Thread Stephen
Sorry, I'm using MySQL. - Original Message - From: "Marco Tabini" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]> Cc: "PHP List" <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 4:00 PM Subject: Re: [PHP] Getting Newest

Re: [PHP] Getting Newest

2002-11-06 Thread Marco Tabini
That depends on what DBMS you are using. Which one is it? Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://www.phparch.com! --- Begin Message --- I have three tables with certain