Jump to content

need help with php varariables in mysql update statment


offsprg01

Recommended Posts

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'";

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.