Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 26th, 2012, 01:28 AM
Authorized User
Points: 64, Level: 1
Points: 64, Level: 1 Points: 64, Level: 1 Points: 64, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default QUERY TO extract data from database

ok i have data stored in my database field is datetime/timestamp.
so what i want is, i want data to be displayed which is older than 24 hours only.

SO how could i write query for that??
Reply With Quote
  #2 (permalink)  
Old September 19th, 2012, 06:30 AM
Registered User
 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the info you can find your answers here.. Php and Mysql with basic javascripts.
http://www.wiziq.com/course/5871-php...egrated-course
Reply With Quote
  #3 (permalink)  
Old October 25th, 2012, 06:05 PM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by internetpirate11 View Post
ok i have data stored in my database field is datetime/timestamp.
so what i want is, i want data to be displayed which is older than 24 hours only.

SO how could i write query for that??
Code:
SELECT * FROM table WHERE datetime <(UNIX_TIMESTAMP(NOW()) - 24*60*60);
A UNIX timestamp is a count of seconds since 1 Jan 1970 24*60*60 is the number of seconds in 24 hours.

You can also write (IIRC):

Code:
WHERE datediff(hh, datetime, NOW()) < 24
__________________
--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
Reply With Quote
  #4 (permalink)  
Old November 21st, 2012, 04:15 AM
Authorized User
Points: 64, Level: 1
Points: 64, Level: 1 Points: 64, Level: 1 Points: 64, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you....................
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract Query from OLEDB Datasource lavisualstudio BOOK: Professional Microsoft SQL Server 2008 Integration Services ISBN: 978-0-470-24795-2 0 August 4th, 2010 11:19 PM
Query to extract data from 2 tables of .mdb file Subuana Beginning VB 6 6 March 16th, 2006 04:37 PM
Extract Excel data to Access Database sriramus Access VBA 1 February 28th, 2006 01:52 PM
Extract build data from Oracle database chandra1977 Oracle 1 March 11th, 2004 02:22 PM
A query to extract part of a string RayL Access 3 March 10th, 2004 09:42 AM



All times are GMT -4. The time now is 06:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.