NetNeo Posted January 13, 2005 Share Posted January 13, 2005 I have a PHP/MySQL site that I am designing in Dreamweaver. This probelm sort of covers php and MySql and Dreamweaver. I have been putting information into a MySQL database with the standard INSERT script built into dreamweaver. Hoever, one field is auto generated with the TIME() function and is a hidden text feild. This is being inserted find, but when I try to build a MySQL SELECT statement in Dreamweaver (or by hand even!) I cannot work out how to call all records that have been entered in a certain date. (I understand the time() includes not only date but also time information. efforts so far have resulted in no data being listed in a dynamic table and the time has obviously changed between entering the info and the SLECT function running...therefore I just get a blank list)....can Anyone help as I am realy pulling my hair out and my manager wants me to prodcue a page that will display all quotes from the database that have been done on a certain day. Many thanks for those php/MySQL/Dreamweaver experts out there who can help Quote Link to comment https://forums.phpfreaks.com/topic/2128-dreamweaver-select-function-with-date-variables/ Share on other sites More sharing options...
pecos Posted January 13, 2005 Share Posted January 13, 2005 The TIME data-type doesn't include date-information. Use DATETIME, if you want both. Here are MySQL's date and time related function. To insert the current date, time or datetime use NOW(). And you would select today's quotes like so: [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * FROM quotes WHERE DATE(quoteAdded) = CURDATE(); [!--sql2--][/div][!--sql3--] (Note: Works with MySQL 4.1+) Quote Link to comment https://forums.phpfreaks.com/topic/2128-dreamweaver-select-function-with-date-variables/#findComment-6978 Share on other sites More sharing options...
NetNeo Posted January 13, 2005 Author Share Posted January 13, 2005 Many, many (and did I say many?) thanks for this little insite to where I am going wrong. Fortunately there isnt many quotes yet so I can change the time() to datetime(). Quote Link to comment https://forums.phpfreaks.com/topic/2128-dreamweaver-select-function-with-date-variables/#findComment-6979 Share on other sites More sharing options...
pecos Posted January 13, 2005 Share Posted January 13, 2005 You're welcome! Quote Link to comment https://forums.phpfreaks.com/topic/2128-dreamweaver-select-function-with-date-variables/#findComment-6980 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.