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:
<?php
$con = mysql_connect('localhost', 'coach_wrdp1a', '12345');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("coach_wrdp1", $con);
mysql_query("UPDATE wp-posts SET post_status = 'publish'
WHERE post_status='future' AND post_date <= now()");
mysql_close($con);
?>
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!