The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
There are no stupid questions??
Discuss There are no stupid questions?? in the PHP Development forum on Dev Shed. There are no stupid questions?? PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

September 10th, 1999, 05:26 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
How do I pass the CURDATE() mySQL function in a PHP query???
Obviously, I'm missing something real simple here.
Trying to use PHP to pass "NOW" as the date in a date field. "quest_date" is the not null date field(below).
I just want the current date inserted where I have "NULL" below.
This Insert isn't working:
$query = "INSERT INTO questions (quest_name, quest_email, cat_id, quest_show, quest_text, quest_ip, quest_date) VALUES ('$quest_name', '$quest_email','$cat_id', 't', '$quest_text', '$orig_ip', NULL)";
Is there a way to add the CURDATE() mySQL function to where the "NULL" is above?
Forgive my ignorance.
Thanks in advance.
|

September 10th, 1999, 09:03 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
$query = "INSERT INTO questions VALUES ('$quest_name', '$quest_email','$cat_id', 't', '$quest_text', '$orig_ip', 'CURDATE())";
|

September 10th, 1999, 09:07 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
I really screwed up the answer, this is it I hope :-)
$query = "INSERT INTO questions VALUES ('$quest_name', '$quest_email','$cat_id', 't', '$quest_text', '$orig_ip', 'CURDATE()')";
|

September 10th, 1999, 09:11 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
I'm really exhausted I think. Just type CURDATE() not 'CURDATE()'.
There's no stupid question but dumb answers. One should always avoid sleep depreva tion.
|

September 20th, 1999, 04:41 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Worked perfect - thanks a million
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|