473,480 Members | 2268 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pulling data from a MySQL database with PHP date code??

Hi,
I am trying to find ways to retrieve data by date from a mysql database.
What I would like to do is to have the option for people to retrieve a file
that was entered in the week before the current day (something like click
here for all drinks added in the last week) I have tried to make this code
work, the only way I can is to manually change the date every day, I would
like it to do it automatically.

Thanks,
Wild Child
Jul 17 '05 #1
1 2820

On 11-Jan-2004, "Wild Child" <In**@Bar-Guide.ca> wrote:
I am trying to find ways to retrieve data by date from a mysql
database.
What I would like to do is to have the option for people to retrieve a
file
that was entered in the week before the current day (something like click
here for all drinks added in the last week) I have tried to make this
code
work, the only way I can is to manually change the date every day, I would
like it to do it automatically.


assuming you have a column called date in you table

select * from tablename where date<date_sub(now(),interval 7 day)

--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
7027
by: Philip D Heady | last post by:
Ok, as some of you may know I'm an Oracle newbie w/ PHP. I'd rather use MySQL but at the office here we use Oracle and boy do I have alot to learn. I'm starting to hate it after using MySQL!! ...
6
3350
by: LRW | last post by:
I have an automated process which uploads a comma separated spreadsheet (csv) and inserts it into a database: $sql = "LOAD DATA INFILE '".$uploadfile."' INTO TABLE `tbl_tracking` FIELDS...
1
2608
by: Yong Wang | last post by:
> Hi: > We have a database system. In the database, we have an > attribute called date0, which contains date data (format: > i. e. 2004-08-12). I wrote a script to fetch the data > in a...
1
532
by: Jason | last post by:
I have a form which ads a technician service ticket into mysql. The fields are tech name time spent service client name etc... I assumed that mysql was storing the date of each record...
6
3962
by: Piotr | last post by:
Hi, I have following problem: I use a form in excel to send data into mysql server, everything is ok unless I have to deal with decimals or data fields, this simple are not recognized. For...
3
3273
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
1
2869
by: xx75vulcan | last post by:
I have created an ASP page that will "on the fly" create an XML feed from my MS SQL database and the contents within a specified table. The Feed: http://www.rockwood.k12.mo.us/news/rss.asp You...
6
1916
by: yenfa | last post by:
I've done a simple PHP-thing which adds data into my mySQL database, using that "PHP $_POST" thing, now I want to do editing that data through PHP form again, but I don't know how to do that. I've...
2
5483
by: macdalor | last post by:
I'm trying to add a guestbook to my website and got these scripts from the net (http://www.phpeasystep.com/workshopview.php?id=15) but only 1d and date&time are being recorded in the sql db; name,...
0
7051
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6915
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7054
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7097
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.