Portal Home > Knowledgebase > Articles Database > Help Needed in executing sql query
Help Needed in executing sql query
Posted by pcaisc, 11-10-2008, 07:36 AM |
Help Needed in executing sql query
Hi there,
First of, I'm new to this forum and thanks so much for providing this wonderful forum.
I'm trying to develop a simple code to execute mysql query but it doesnt work, here's my code:
Quote:
can someone tell me what did I do wrong here? when I run the files on browser, it doesn't show any error, but my database just didn't update at all.
I double check my login info, db name and user rights, there's no problem out there.
Really appreciate if someone can help here, thanks!
|
Posted by brandowellas, 11-10-2008, 10:16 AM |
Try This
|
Posted by Lagniappe-labgeek, 11-10-2008, 04:56 PM |
Functionally that's pretty much the same code.
Now is a datetime, is post_date just a date? If so, I'd suggest a CURDATE() instead.
What happens if you runs the SQL statement yourself interactively?
Quote:
__________________
Lagniappe (lan-yap) - 1. A small gift presented to a customer with their purchase.
2. An extra or unexpected gift or benefit. "...a word worth travelling to New Orleans to get...", Mark Twain Life on the MississippiLagniappe Internet L.L.C. - Wholesale Reseller, and VPS Hosting.
|
Posted by coloheart, 11-18-2008, 01:45 PM |
What is the datatype of post_date ? Is it datetime or something else ?
|
Posted by foobic, 11-18-2008, 06:48 PM |
Unless someone's changed things radically it's a datetime, but the table name should be wp_posts not wp-posts:
UPDATE wp_posts ...
__________________
Chris
"Not everything that can be counted counts, and not everything that counts can be counted" - Albert Einstein
|
Posted by pcaisc, 11-19-2008, 05:00 AM |
i got it solved now,
yeah, is the table name error, my mistake LOL
Thanks everyone, you guys are awesome!
|
Add to Favourites Print this Article
Also Read
Amazon EC2? (Views: 716)