|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Setting parameter in a query to today's date
Does anyone know how to set up a parameter in a query to equal today's date? I have scoured the internet for some time and scanned the archives but to no avail. Any and all suggestions welcome. Here is the code I have so far.....
$result = mysql_query( "SELECT * FROM ttime where (SNUM = '".$_SESSION['SNUM']."') AND TIDATE = ?today's date? ORDER BY TIDATE DESC") |
|
#2
|
|||
|
|||
|
you might want to try:
TIDATE = NOW() tho that might not be the proper formatting that you need. The NOW() command simply inserts the current system date/time into the variable. |
|
#3
|
|||
|
|||
|
please tell us what are you using: MySQL, MSSQL, bacause the data types are not the same. Also be carefull if you installed the SQL Server in other language then english
|
|
#4
|
|||
|
|||
|
hi. I suggest, that you do following:
if you are using the timedate-stamp in the db use this: PHP Code:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Setting parameter in a query to today's date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|