vineet
10-14-2008, 04:25 AM
hi all
i m using xampp.
i have created a field column "dob" means date of birth in my mysql table and set the datatype to "date".
I m fetching the result of the table from a php form. when i insert the date in the date input field say example 1982/10/10. everytime it displays result as 0000-00-00.
why is it showing zeros
vineet
Moshambi
10-14-2008, 05:26 AM
Are you sure you are inserting the date into the database before you are trying to pull it out? If so could you show some code for some better help.
vineet
10-14-2008, 05:49 AM
Are you sure you are inserting the date into the database before you are trying to pull it out? If so could you show some code for some better help.
Hi
this is the mysql code that showsup when exported.
-- phpMyAdmin SQL Dump
-- version 2.11.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 14, 2008 at 05:44 AM
-- Server version: 5.0.51
-- PHP Version: 5.2.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `training`
--
-- --------------------------------------------------------
--
-- Table structure for table `student`
--
CREATE TABLE IF NOT EXISTS `student` (
`student_id` int(11) NOT NULL auto_increment,
`student_name` varchar(30) NOT NULL,
`fee` float(9,2) NOT NULL,
`dob` date NOT NULL,
`age` int(3) NOT NULL,
`picture` varchar(40) NOT NULL,
PRIMARY KEY (`student_id`),
UNIQUE KEY `student_name` (`student_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
--
-- Dumping data for table `student`
--
INSERT INTO `student` (`student_id`, `student_name`, `fee`, `dob`, `age`, `picture`) VALUES
(7, 'jumin', 7800.00, '0000-00-00', 23, ''),
(3, 'sukh', 1600.00, '0000-00-00', 60, '74_106.JPG'),
(5, 'makhinder', 7200.00, '0000-00-00', 99, '06_120.JPG'),
(6, 'hemu', 1250.00, '0000-00-00', 52, '');
NXArmada
10-14-2008, 02:20 PM
can you post your php code?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.