Re: [PHP-DB] Inserting current date(MySQL)?
> I'm my trying to insert to current date from a php form? I know that > MySQL has a CURDATE() fucntion and PHP has several date function, but I > cann't seem to get either to work? Here is my existing code: > $ADDDATE=date("Y-m-d"); [snip] > VALUES ('$_POST[ADDDATE]', You've got two different variables there. You should just use $ADDDATE in your query. Or, like you said, just use CURDATE() or NOW() in your query. VALUES (NOW(), ... VALUES (CURDATE(), ... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Inserting current date(MySQL)?
it looks like you have defined $ADDDATE and it is not a posted variable. what happens if you just have: Jeff David Jackson cc: Subject: [PHP-DB] Inserting current date(MySQL)? 10/30/2002 01:31 PM Howdy -- I'm my trying to insert to current date from a php form? I know that MySQL has a CURDATE() fucntion and PHP has several date function, but I cann't seem to get either to work? Here is my existing code: TIA, David Jackson -- client_add.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Inserting current date(MySQL)?
Howdy -- I'm my trying to insert to current date from a php form? I know that MySQL has a CURDATE() fucntion and PHP has several date function, but I cann't seem to get either to work? Here is my existing code: TIA, David Jackson -- client_add.php $ADDDATE=date("Y-m-d"); mysql_query ("INSERT INTO client (cl_add_date, cl_first_name, cl_last_name, cl_company, cl_phone, cl_email, cl_address, cl_city, cl_state, cl_zip, cl_web) VALUES ('$_POST[ADDDATE]', '$_POST[cl_first_name]', '$_POST[cl_last_name]', '$_POST[cl_company]', '$_POST[cl_phone]', '$_POST[cl_email]', '$_POST[cl_address]', '$_POST[cl_city]', '$_POST[cl_state]', '$_POST[cl_zip]', '$_POST[cl_web]') "); ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php