Warptweet Posted March 1, 2007 Share Posted March 1, 2007 In my database, one of the columns is "date". The date uses the TIMESTAMP( code, which means it stores the date that the row was created. How would I be able to find how many rows were entered the particular day? (E.G. How many today, when it's tommorow, it will display how many were uploaded tommorow, and so forth) And once it does that, display a NUMBER of how many rows were entered today? EXAMPLE OF TIMESTAMP(: 2007-02-24 21:14:50 Thats an example of what TIMESTAMP( does, you can use that to find how many rows were entered today. Link to comment https://forums.phpfreaks.com/topic/40782-todays-database-entries/ Share on other sites More sharing options...
bwochinski Posted March 1, 2007 Share Posted March 1, 2007 SELECT COUNT(*) FROM your_table WHERE date >= CURDATE() Link to comment https://forums.phpfreaks.com/topic/40782-todays-database-entries/#findComment-197435 Share on other sites More sharing options...
Warptweet Posted March 1, 2007 Author Share Posted March 1, 2007 Is that SQL? Or is that PHP? Link to comment https://forums.phpfreaks.com/topic/40782-todays-database-entries/#findComment-197437 Share on other sites More sharing options...
Archadian Posted March 1, 2007 Share Posted March 1, 2007 mysql_query("SELECT COUNT(*) FROM your_table WHERE date >= CURDATE()") Link to comment https://forums.phpfreaks.com/topic/40782-todays-database-entries/#findComment-197438 Share on other sites More sharing options...
bwochinski Posted March 1, 2007 Share Posted March 1, 2007 That's your SQL. The PHP is something like: <?php $count_res = mysql_query("SELECT COUNT(*) FROM your_table WHERE date >= CURDATE()"); $count = mysql_result($count_res,0); ?> And there's your "$count" Link to comment https://forums.phpfreaks.com/topic/40782-todays-database-entries/#findComment-197442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.