Re: [PHP] Selecting all records between a date range

2008-10-08 Thread Andrew Ballard
On Tue, Oct 7, 2008 at 9:16 PM, Chris [EMAIL PROTECTED] wrote: Dan Joseph wrote: On Thu, Oct 2, 2008 at 12:35 PM, Jason Pruim [EMAIL PROTECTED] wrote: SQLTEST: SELECT * FROM `timeStore` WHERE`timein` BETWEEN 1222315200 AND 122292 Could not perform query: Query was empty

Re: [PHP] Selecting all records between a date range

2008-10-08 Thread Eric Butera
On Thu, Oct 2, 2008 at 12:35 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi Everyone, I am working on a app where I need to be able to select all the values from a database where the 'timein' field is between a certain date range... Essentially the last 7 days... here is the code that I am

Re: [PHP] Selecting all records between a date range

2008-10-07 Thread Chris
Dan Joseph wrote: On Thu, Oct 2, 2008 at 12:35 PM, Jason Pruim [EMAIL PROTECTED] wrote: SQLTEST: SELECT * FROM `timeStore` WHERE`timein` BETWEEN 1222315200 AND 122292 Could not perform query: Query was empty [EMAIL PROTECTED] Put a ' around your timestamp numbers. I

[PHP] Selecting all records between a date range

2008-10-02 Thread Jason Pruim
Hi Everyone, I am working on a app where I need to be able to select all the values from a database where the 'timein' field is between a certain date range... Essentially the last 7 days... here is the code that I am working with: $rangeBegin = strtotime(Last week thursday

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Per Jessen
Jason Pruim wrote: Hi Everyone, I am working on a app where I need to be able to select all the values from a database where the 'timein' field is between a certain date range... Essentially the last 7 days... SELECT * FROM timeStore WHERE timeinDATE_SUB(now(),INTERVAL 7 DAYS) /Per

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Jim Lucas
Jason Pruim wrote: Hi Everyone, Could not perform query: Query was empty This would tell me that the variable that you are passing to your function call is either empty or not set. Maybe a typo. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Jason Pruim
On Oct 2, 2008, at 12:39 PM, Per Jessen wrote: Jason Pruim wrote: Hi Everyone, I am working on a app where I need to be able to select all the values from a database where the 'timein' field is between a certain date range... Essentially the last 7 days... SELECT * FROM timeStore

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Jason Pruim
On Oct 2, 2008, at 12:46 PM, Jim Lucas wrote: Jason Pruim wrote: Hi Everyone, Could not perform query: Query was empty This would tell me that the variable that you are passing to your function call is either empty or not set. Maybe a typo. Hi Jim, Wouldn't that have shown up in

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Jason Pruim
On Oct 2, 2008, at 1:17 PM, Jason Pruim wrote: On Oct 2, 2008, at 12:46 PM, Jim Lucas wrote: Jason Pruim wrote: Hi Everyone, Could not perform query: Query was empty This would tell me that the variable that you are passing to your function call is either empty or not set. Maybe a

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Robbert van Andel
What is the actual code that you use to run the query. You've shown us how you set up the query but not more. Something like $result = mysql_query($query,$conn); Robbert On Thu, Oct 2, 2008 at 10:17 AM, Jason Pruim [EMAIL PROTECTED] wrote: On Oct 2, 2008, at 12:46 PM, Jim Lucas wrote:

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Dan Joseph
On Thu, Oct 2, 2008 at 12:35 PM, Jason Pruim [EMAIL PROTECTED] wrote: SQLTEST: SELECT * FROM `timeStore` WHERE`timein` BETWEEN 1222315200 AND 122292 Could not perform query: Query was empty [EMAIL PROTECTED] Put a ' around your timestamp numbers. I think that should

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Maciek Sokolewicz
Dan Joseph wrote: On Thu, Oct 2, 2008 at 12:35 PM, Jason Pruim [EMAIL PROTECTED] wrote: SQLTEST: SELECT * FROM `timeStore` WHERE`timein` BETWEEN 1222315200 AND 122292 Could not perform query: Query was empty [EMAIL PROTECTED] Put a ' around your timestamp numbers. I

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Robbert van Andel
In the original message you were assigning the query to $SQLTEST, but in the code below you're using $sql. On Thu, Oct 2, 2008 at 10:40 AM, Jason Pruim [EMAIL PROTECTED] wrote: On Oct 2, 2008, at 1:31 PM, Robbert van Andel wrote: What is the actual code that you use to run the query. You've

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Jason Pruim
On Oct 2, 2008, at 1:31 PM, Robbert van Andel wrote: What is the actual code that you use to run the query. You've shown us how you set up the query but not more. Something like $result = mysql_query($query,$conn); Here is the code I use: $row[]= mysql_query($sql) or die(Could not

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Jim Lucas
Jason Pruim wrote: On Oct 2, 2008, at 12:39 PM, Per Jessen wrote: Jason Pruim wrote: Hi Everyone, I am working on a app where I need to be able to select all the values from a database where the 'timein' field is between a certain date range... Essentially the last 7 days... SELECT

Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Jason Pruim
On Oct 2, 2008, at 1:45 PM, Robbert van Andel wrote: In the original message you were assigning the query to $SQLTEST, but in the code below you're using $sql. It was a clean up... I had a working query... $sql so in attempting to improve this I didn't want to lose the original sql so I