Okay, I am having a problem with script... please help... Error: Parse error: syntax error, unexpected T_VARIABLE Im guessing in the mysql query, please help. <?php include('include/config.php'); include('include/function.php'); $future = date("Y:m:d G:i:s", strtotime("+3 day")); $mysql_host = "localhost"; $mysql_username = "user"; $mysql_password = "pass"; $mysql_database = "db"; $UID = $_REQUEST['UID']; mysql_query("UPDATE subscriber SET expired_time='"$future"' WHERE UID='"$UID"'") or die(mysql_error()); mysql_close(); ?> PHP:
hi, Please replace below line and it's work fine mysql_query("UPDATE subscriber SET expired_time='".$future."' WHERE UID='".$UID."'") or die(mysql_error());
Try this: mysql_query("UPDATE subscriber SET expired_time='{$future}' WHERE UID={$UID}") or die(mysql_error()); PHP: Regards Edit: And, of course, you've to connect and select_db before querying DB.
Hi thanks for the reply, I have sorted it myself now, I used this: mysql_query("UPDATE subscriber SET expired_time='" .mysql_real_escape_string($future). "' WHERE UID='" .mysql_real_escape_string($UID). "'") or die(mysql_error());