offsprg01 Posted February 26, 2007 Share Posted February 26, 2007 here's the error You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'coconut3.jpg''), StartDate=(''30-11-1999''), EndDate=(''30-11-1 here's the code $insertSQL = "UPDATE PromoImages SET FileName='$filename', StartDate='$startDateComp', EndDate='$endDateComp', `Default`='$default', LeftRight='$leftRight' WHERE ID='$id'"; Link to comment https://forums.phpfreaks.com/topic/40237-need-help-with-php-varariables-in-mysql-update-statment/ Share on other sites More sharing options...
redarrow Posted February 26, 2007 Share Posted February 26, 2007 try this ok. $insertSQL = "UPDATE `PromoImages` SET `FileName`='$fileName',`StartDate`='$startDate', `EndDate`='$EndDateComp', `Default`='$Default', `LeftRight`='$LeftRight' WHERE `ID`='$Id'"; Link to comment https://forums.phpfreaks.com/topic/40237-need-help-with-php-varariables-in-mysql-update-statment/#findComment-194680 Share on other sites More sharing options...
craygo Posted February 26, 2007 Share Posted February 26, 2007 seems your filename has some illegal characters in it. try this <?php $filename = mysql_real_escape_string($filename); $insertSQL = "UPDATE PromoImages SET FileName='$filename', StartDate='$startDateComp', EndDate='$endDateComp', `Default`='$default', LeftRight='$leftRight' WHERE ID='$id'"; ?> Ray Link to comment https://forums.phpfreaks.com/topic/40237-need-help-with-php-varariables-in-mysql-update-statment/#findComment-194681 Share on other sites More sharing options...
offsprg01 Posted February 26, 2007 Author Share Posted February 26, 2007 craygo you would be correct. problem solved. thanks. Link to comment https://forums.phpfreaks.com/topic/40237-need-help-with-php-varariables-in-mysql-update-statment/#findComment-194761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.