View Full Version : PhpMyAdmin help
Decode
30-06-2008, 04:42 PM
http://www.tehupload.com/images/app-24296885554859376235.png
Ive got a table and i need date and time for it, ive set the type to date but when i use
mysql_query("INSERT INTO datetime (date, time) VALUES('" . $date . "', '" . $time . "' )")
It puts the date as 0000-00-00 and the time as 00:00:00 instead of what i set it to.
ps. the $date var is $date = date("d/m/y")
Protege
30-06-2008, 05:30 PM
Dont use table field types if you don't understand what they mean - use text/var chars/ints
Decode
30-06-2008, 05:37 PM
Dont use table field types if you don't understand what they mean - use text/var chars/ints
I would use the default one, but i can't use "order" then because it will order them like this;
02-03-08
04-08-09
09-01-00
12-04-08
13-12-01
It treats the "-" like decimal points.
Jackboy
30-06-2008, 08:23 PM
have the fields as varchar? U mayswell...
Decode
30-06-2008, 08:58 PM
have the fields as varchar? U mayswell...
Read post #3. Its for a PM list so they need to be ordered by date, and having them as varchar won't work for that.
Jackboy
01-07-2008, 04:56 PM
ohhhhhhhhhhhhhhhhhhhhhh
Insure date is in the following format: YYYY-DD-MM and time is: HH:MM:SS and is a valid time/date.
Trinity
01-07-2008, 07:54 PM
Read post #3. Its for a PM list so they need to be ordered by date, and having them as varchar won't work for that.
Couldn't you order them by an id field or something?
Decode
01-07-2008, 08:33 PM
Insure date is in the following format: YYYY-DD-MM and time is: HH:MM:SS and is a valid time/date.
Thanks :) +rep.
Couldn't you order them by an id field or something?
If i did that then i would have the same problem as using varchar?
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.