|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
DB Schematic
id (INT) autoinc. ev_date (date) user (VARCHAR) notes (TEXT) What I need is the piece of code to insert the data into the db and finally a way to diplay them ordered by DATE. I have created a form that gives these: $day , $month , $year , $user , $notes I know how to insert the rest tell me how to handle the date insertion. Thank you in advance. |
|
#2
|
||||
|
||||
|
It depends if you just want the current date use the function now(), otherwise you can enter it in a few ways.
Code:
INSERT INTO (ev_date, user, notes) VALUES (now(), 'username', 'notes')
// or
INSERT INTO (ev_date, user, notes) VALUES ('2004-10-13', 'username', 'notes')
http://dev.mysql.com/doc/mysql/en/INSERT.html |
|
#3
|
|||
|
|||
|
Quote:
Hi, Try and create a unified field like $newdate = $year."-".$month."-".$day; coz mysql takes dates only in Y m d format and then try to run the insert query like $result = mysql_query("insert into database_name set date='$date' where [clause]"); ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Ordering by DATE |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|