eelixduppy

msg:4308467 | 8:32 pm on May 5, 2011 (gmt 0) |
Just to clarify, do you mean from a single table/relation or from an entire MySQL database (e.g., for backup purposes)?
|
scrupply

msg:4308468 | 8:43 pm on May 5, 2011 (gmt 0) |
The information would come through a single call and then would display out on a page.
|
rocknbil

msg:4308492 | 9:59 pm on May 5, 2011 (gmt 0) |
Welcome aboard . . . you have a field with the data type of date or datetime . . .then select * from table where datefield >= date_sub(curdate(), interval 7 day); If you don't have a field with a date/timestamp, you should. :-) Create one. Alter table tablename add datefield datetime not null default '0000-00-00 00:00:00'; Try to avoid naming fields the same name as reserved words . . . date, datetime, insert, etc.
|
scrupply

msg:4308816 | 4:53 pm on May 6, 2011 (gmt 0) |
I have a field that is datetime (mysql) and I am trying to pull the data from that table that is within the last 7 days (PHP).
|
rocknbil

msg:4308833 | 5:17 pm on May 6, 2011 (gmt 0) |
Well that should do it. :-)
|
scrupply

msg:4308837 | 5:27 pm on May 6, 2011 (gmt 0) |
What should do it? I think that I am lost.
|
rocknbil

msg:4309909 | 4:32 pm on May 9, 2011 (gmt 0) |
| What should do it? I think that I am lost. |
| | I have a field that is datetime (mysql) and I am trying to pull the data from that table that is within the last 7 days (PHP). |
| Substitute "datefield" for whatever that field is named and "table" for the name of the table. select * from table where datefield >= date_sub(curdate(), interval 7 day); In PHP, that would be something like $query = "select * from table where datefield >= date_sub(curdate(), interval 7 day)"; $result = mysql_query($query) or die("Cannot get last 7 days: " . mysql_error()); while ($row = mysql_fetch_array($result)) { // Row data is stored in $row, whatever the field names are . . . . echo "<p>ID: " . $row['id'] . " date: " . $row['datefield'] . "</p>"; }
|
scrupply

msg:4314963 | 10:39 pm on May 19, 2011 (gmt 0) |
Thank you, I think that this did it.
|
|