[PHP-DB] MySQL: getting latest record

2003-12-14 Thread ShortStay
My application is that I am getting the latest quote for a price where more
than one quote may have been made.

I've got a timestamp colum and I want to get the latest record where certain
columns have certain values.  Eg

SELECT * FROM MyTable WHERE Field1='test' ...?  something about the
timestamp

I may also have an OR in the condition, like WHERE Field1='test1' OR
Field2=test2'...'test1' and test2' would be different products.

Do I have to use ASCending or DESCending on the timestamp column and LIMIT?

Never done this before so suggestions gratefully received.

Thanks,

John

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL: getting latest record

2003-12-14 Thread jeffrey_n_Dyke

you've just about got it in your question.

SELECT * FROM MyTable WHERE Field1='test' OR Field2='test2' ORDER BY
TIMSTAMP DESC LIMIT 1

hth
Jeff


   

  ShortStay  

  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]  
  
  ondon.com   cc: 

   Subject:  [PHP-DB] MySQL: getting 
latest record 
  12/14/2003 10:47 

  AM   

   

   





My application is that I am getting the latest quote for a price where more
than one quote may have been made.

I've got a timestamp colum and I want to get the latest record where
certain
columns have certain values.  Eg

SELECT * FROM MyTable WHERE Field1='test' ...?  something about the
timestamp

I may also have an OR in the condition, like WHERE Field1='test1' OR
Field2=test2'...'test1' and test2' would be different products.

Do I have to use ASCending or DESCending on the timestamp column and LIMIT?

Never done this before so suggestions gratefully received.

Thanks,

John

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Informix - help!

2003-12-14 Thread Daniel Crespo
I have red hat linux with Apache web server and PHP. I want to connect,
using PHP, to an Informix Database remotely. What is all I have to do on my
side? Thanks a lot

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] php mail() question

2003-12-14 Thread JeRRy
Hi,

Php mail() question.

I use php mail() frequently, dragging data from a
mysql database.  I am not sure if this is possible but
thought I'd throw it on this board.

in php mail() function you can set a return_address
etc.  Is it possible to change this and run a query? 
I mean if the email bounces can it somehow talk back
to php mail() and do a query rather than send it to
the return_address?

Thanks!

http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php