[PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Govinda
Hi all I'm translating some code from another server-side language into PHP, and I need something that 'summarizes' results found from a MySQL SELECT. I.e. - $foundTrackingRows=mysql_query(SELECT... while ($TrackingRow = mysql_fetch_object($foundTrackingRows)) {... ..such that the while

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Chris
Govinda wrote: Hi all I'm translating some code from another server-side language into PHP, and I need something that 'summarizes' results found from a MySQL SELECT. I.e. - $foundTrackingRows=mysql_query(SELECT... while ($TrackingRow = mysql_fetch_object($foundTrackingRows)) {... ..such

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Govinda
You need to do this on the mysql side, not in php - php can't summarize the data before processing it, so you need to use something like the date() function in mysql on your timestamp column. http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date without knowing

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Bastien Koert
On Sun, Aug 2, 2009 at 8:02 PM, Govindagovinda.webdnat...@gmail.com wrote: You need to do this on the mysql side, not in php - php can't summarize the data before processing it, so you need to use something like the date() function in mysql on your timestamp column.

[PHP-DB] Access a database on another domain

2009-08-02 Thread Neil Jackson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I host a number of running clubs websites. They are all hosted on different domains on a hosting service. They all share a common database table of fixtures. At present I have copied the database table to each domain but this time consuming. I

Re: [PHP-DB] Access a database on another domain

2009-08-02 Thread Chris
Neil Jackson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I host a number of running clubs websites. They are all hosted on different domains on a hosting service. They all share a common database table of fixtures. At present I have copied the database table to each domain but

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Govinda
On Sun, Aug 2, 2009 at 8:02 PM, Govindagovinda.webdnat...@gmail.com wrote: You need to do this on the mysql side, not in php - php can't summarize the data before processing it, so you need to use something like the date() function in mysql on your timestamp column.

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Govinda
What does the resultset look like? I am getting every record in the table back

Re: [PHP-DB] Access a database on another domain

2009-08-02 Thread Bastien Koert
On Sun, Aug 2, 2009 at 10:15 PM, Chrisdmag...@gmail.com wrote: Neil Jackson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I host a number of running clubs websites. They are all hosted on different domains on a hosting service. They all share a common database table of

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Bastien Koert
On Sun, Aug 2, 2009 at 11:13 PM, Govindagovinda.webdnat...@gmail.com wrote: What does the resultset look like? I am getting every record in the table back my bad, i reversed the mysql and php date function formats try SELECT distinct( DATE_FORMAT( fieldname, '%Y-%m-%d' ) ) FROM table ORDER

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Niel Archer
You need to do this on the mysql side, not in php - php can't summarize the data before processing it, so you need to use something like the date() function in mysql on your timestamp column. http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date

[PHP-DB] AUTO: George Tomescu is out of the office. (returning 24/08/2009)

2009-08-02 Thread George Tomescu
I am out of the office until 24/08/2009. I will have limited access to email during this time. If you have a TRAXi3 or general Precision query, please contact helpl...@precisionsoftware.com. It is recommended that you contact your Precision Project Manager for further assistance. Or visit

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Niel Archer
You need to do this on the mysql side, not in php - php can't summarize the data before processing it, so you need to use something like the date() function in mysql on your timestamp column. http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Govinda
Oops, forgot to mention that with the alias you can change the ORDER BY clause to use the aliased column data: ORDER BY solarLandingDate DESC this will only use the returned data instead of the entire column. If you are aliasing a column it is better to use the optional AS keyword to avoid

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Jack van Zanen
The distinct can only work as you want it to work when you only select the date column and only the date part (not the time part). Unfortunately I'm more an oracle DBA where the date functions are more clear to me so can not help with exact syntax. I think what you should be doing is returning

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Niel Archer
The distinct can only work as you want it to work when you only select the date column and only the date part (not the time part). Unfortunately I'm more an oracle DBA where the date functions are more clear to me so can not help with exact syntax. I think what you should be doing is