473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

cannot store this date in mysql table

232 100+
i hav a dropdown list of date 1-31
month january-december
year 2001-2009
i want to save it in musql database with dob field datatype date

$month=$_POST['month'];
$date=$_POST['date'];
$year=$_POST['year'];
$dob="$year/$month/$date";
i want to store this date in mysql table but it doesnt work date still remain 0000-00-00
insert into emp (dob) values('$dob')
Jul 29 '09 #1
7 2273
Dheeraj Joshi
1,123 Expert 1GB
Whether data type of key is varchar(size) or date in your database?
Jul 29 '09 #2
kkshansid
232 100+
@dheerajjoshim
its date and field name is dob
Jul 29 '09 #3
gregerly
192 Expert 100+
Try

$dob = $year. '-' . $month . '-' . $day;

Greg
Jul 29 '09 #4
kkshansid
232 100+
@gregerly
no even it doesnt work
Jul 29 '09 #5
kkshansid
232 100+
it happened i changed it from january-dec to 1-12
Jul 29 '09 #6
you change your data type in your table.., ie., VARCHAR(100)...
Jul 29 '09 #7
you changed this $dob="$year/$month/$date"; to
$dob=$year."-".$month."-".$date";....
now you store $dob it will be worked...
Jul 29 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: jacob nikom | last post by:
Hi, I would like to store XML files in MySQL. What is the best solution: 1. Convert it to string and store it as CLOB/text 2. Serialize it and store as byte array 3. Flatten it out and create...
3
by: usenet | last post by:
I have inherited a table where date information was saved from PHP as a VARCHAR. (Sigh.) This means that the so-called date fields look like this : August 1, 2005, 9:09 am EDT October 13, 2004,...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: maddunr | last post by:
Hello All, The other day my server running MySQL 3.23.58 got hacked into and we are migrating to another one. I backed up my databases using two methods a) Mysqldump and b) copy the DATA folder...
19
by: Michael | last post by:
Hi, I'm trying to do something which should be very simple - connect to the MySQL database. Here is the call, followed by the error msg. $conn = mysql_connect("localhost", "root", ""); ...
3
by: raahat | last post by:
hi, i need to do desperately the way of storing american DATE formate( like 27-02-2007) in mysql table.i searched on the web a lot,but didnt find anything.PLZ i need someone's help.
3
by: Hazza | last post by:
Hi, I am using PHP and mysql to create a website. I am fairly new to PHP, and thus am grateful to anyone who helps! Firstly I am running a homepage, that displays additional content if a user...
4
elen
by: elen | last post by:
hi! I wish for your help! I have a form and i want to store the results to my database and show me back what i sent to database,but my php script won't work.Can somebody help me ?I'm new in php ...
3
by: janetopps | last post by:
I have a news website, with asp pages, which was on Access, and i upgraded to MySQL, i used Bullzip to transfer the data. It had about 1000 pages, which im now able to pull up on the public side. Im...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.