Ok I went through and corrected the smart quotes. and the echo and now i am getting this
Parse error: syntax error, unexpected T_STRING in /home/mamabear/public_html/wordpressdate.php on line 35
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body><?php // define mysql connect
$dbname = "*****";
$dbuser = "*****";
$dbpass = "*****";
$dbhost = "localhost"; // this will usually stay 'localhost'
$my_table = "pa-videos"; // define wordpress table name
$gmt_offset = '-6'; // -8 for California, -5 New York, -6 Missouri etc.
// I'm setting into the future year so WordPress can publish as , else I would use 1 for min and 60 for max, for last 2 months.
$min_days_old = -365; // the minimum number of days old
$max_days_old = 7; // the maximum number of days old
// connect to db
mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname);
$result = mysql_query("SELECT ID FROM $my_table") or die(mysql_error());
while ($l = mysql_fetch_array($result)) {
$post_id = $l['ID'];
echo "Updating: $post_id
";
$day = rand($min_days_old, $max_days_old);
$hour = rand(0, 23);
$new_date = date;( ‘Y-m-d H:i:s’, strtotime("-$day day -$hour hour" ) );
$gmt_new_date = date( ‘Y-m-d H:i:s’, strtotime("-$day day -$hour hour -$gmt_offset hour" ) );
mysql_query("UPDATE $my_table SET date=’$new_date’ WHERE ID=’$post_id’" )
or die(mysql_error)));
}
echo "DONE!";
?>
Line 35
$new_date = date;( ‘Y-m-d H:i:s’, strtotime("-$day day -$hour hour" ) );