; <[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
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
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... :
>
&
"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?
> >
> >
> >
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
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]>
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 = &
> $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,
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
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
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
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 thre
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
-
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
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
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
I have three tables with certain content in each that's added almost daily. I want to
get the most recent, out of those three tables, and then display it. How would I do
that without changing the structure of my tables? (My current structure is this: id,
date, name, text)
Thanks,
Stephen Craton
17 matches
Mail list logo