You are here: Re: An SQL search « All PHP « IT news, forums, messages
Re: An SQL search

Posted by Tyrone Slothrop on 08/25/05 17:10

On Thu, 25 Aug 2005 11:17:32 GMT, "Brian" <not@given.com> wrote:

>Hi all
>
>I hope I can explain this properly.....
>
>I'm trying to run a search on a MySQL table that checks if item
>were out of stock between 2 dates and reports it
>
>This is what it need to do
>
>The fields are
>timestamp = the timestamp to search on
>status = the status code, 'o' if out of stock
>ord = the number ordered
>description = the item description
>
>I need to say show me items between startday and endday that were out of
>stock
>and how many were ordered
>
>e.g.
>
>Item A = 400 ordered
>Item B = 250 ordered
>Item C = 100 ordered
>
>What's the best way to do this without have vapours SQL queries?
>
>Any help would be great
>
>Brian

The query is fairly simple:
SELECT * FROM products WHERE (timestamp <= $enddate AND timestamp >=
startdate) AND status = 'o';

However, if you don't know how to structure the query, I have the
feeling you will have a number of other questions. ;-)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация