Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 08-14-2005, 05:21 AM   #1 (permalink)
Inactive
 
Join Date: 10-29-03
Posts: 249
iTrader: 0 / 0%
Latest Blog:
None

Limit is a jewel in the roughLimit is a jewel in the roughLimit is a jewel in the roughLimit is a jewel in the roughLimit is a jewel in the roughLimit is a jewel in the rough
PHP/MySQL Query needed for UNIX Timestamp

Hi i need help with some code.

So far i have gotten my code to count how many records are approved and how many are not approved.

But i need help with making a query that counts the records posted today (on that day). I'm using UNIX timestamp (in PHP time()) to insert the date into a field called date.

Any ideas how i can pull the records posted on today.
Limit is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 08-15-2005, 11:58 AM   #2 (permalink)
v7n Mentor
 
jg_v7n's Avatar
 
Join Date: 08-26-04
Location: Rio de Janeiro
Posts: 1,289
iTrader: 0 / 0%
Latest Blog:
None

jg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web pro
Work out the timestamp for 00:00:00 the previous night - midnight. Then work out the timestamp for 23:59:59 tonight. Then use BETWEEN to select all dates between those two timestamps.

$start_of_day = 193876543;
$end_of_day = 193891359;

$query = "SELECT * WHERE date_column BETWEEN ".$start_of_day." AND ".$end_of_day."";
jg_v7n is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which one faster mysql query? smith Coding Forum 7 03-29-2007 04:41 AM
Need PHP code to pull timestamp from mysql database Kalina Coding Forum 16 07-31-2006 06:25 AM
mysql query problem (php) songwritingfever Coding Forum 3 05-03-2006 12:39 PM
MySQL Query Question Thanol Coding Forum 6 01-17-2006 12:06 PM
Off the shelf databases - unix/MySQL tigermann Coding Forum 2 06-18-2004 03:25 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 03:37 PM.
© Copyright 2008 V7 Inc

Click Here