Jump to content


Photo

cant insert into mysql date (yyyy-mm-dd) field


  • Please log in to reply
1 reply to this topic

#1 justravis

justravis
  • Members
  • PipPipPip
  • Advanced Member
  • 115 posts
  • LocationSan Diego, CA

Posted 15 November 2003 - 07:28 AM

i hav 2 selectboxes for month & yr.

[php:1:7dde7365b6]<?php
$grad_date= \"$grad_yr-$grad_mo-00\";

$studquery=\"INSERT INTO student (`first`, `last`, `nick`, `ss`, `pass`, `phone`, `email`, `emph_id`, `units_left`, `grad_date`) values (\'$first\', \'$last\', \'$nick\', \'$ss\', \'$pass\', \'$phone\', \'$email\', \'$emphasis\', \'$units_left\', \'$grad_date\')\";

?>[/php:1:7dde7365b6]

All the other fields insert except the grad_date just ends up 0000-00-00.

ANY IDEAS WOULD BE GREATLY APPRECIATED!!!!
PHP version 5.2.6 | MySQL version 5.0.51a-community

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,023 posts

Posted 15 November 2003 - 08:12 AM

Assume they are all on the 1st of the month and not the 0th.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users