Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 1st, 2003, 08:47 AM
Authorized User
 
Join Date: Oct 2003
Location: KL, wilayah persekutuan, Malaysia.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default DATE VALUE DISPLAYED NOT AS ENTERED

i build the sales table as below using mysql but the date value that i entered is not the one displayed on the database.

What is the problem? Please help.

mysql> CREATE TABLE SALES
    -> (
    -> SALES_ID INT NOT NULL,
    -> SALES_DATE TIME NOT NULL,
    -> PRIMARY KEY(SALES_ID),
    -> );
Query OK, 0 rows affected (0.02 sec)

mysql> INSERT INTO SALES VALUES(10001,'1998-08-18');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO SALES VALUES(10002,'1999-03-30');
Query OK, 1 row affected (0.01 sec)

mysql> SELECT * FROM SALES;
+----------+------------+
| SALES_ID | SALES_DATE |
+----------+------------+
| 10001 | 00:00:00 |
| 10002 | 00:00:00 |
+----------+------------+
2 rows in set (0.00 sec)

Reply With Quote
  #2 (permalink)  
Old November 1st, 2003, 12:56 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Um I think you want to use a 'date' or 'datetime' field type for that.

http://www.mysql.com/doc/en/DATETIME.html

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
  #3 (permalink)  
Old November 4th, 2003, 10:36 PM
Authorized User
 
Join Date: Oct 2003
Location: KL, wilayah persekutuan, Malaysia.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yup, thanks. i've overlooked. i should have use DATE instead of TIME.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception Entered mh VB.NET 4 October 18th, 2005 12:12 PM
Time displayed with date! Please help Renu ASP.NET 1.0 and 1.1 Basics 18 August 20th, 2004 09:04 AM
Time getting displayed along with Date mahulda Classic ASP Databases 15 August 16th, 2004 02:05 PM
Date and Time Displayed Together in DataGrid mahulda Classic ASP Databases 4 July 17th, 2004 11:03 PM
Date and Time Displayed Together in DataGrid mahulda ADO.NET 2 July 16th, 2004 04:43 AM



All times are GMT -4. The time now is 07:17 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.