Jump to content

Issues with an unexpected '='


dzhax

Recommended Posts

I am working on CMS and need to create a query depending on the data sent to the page.Parse error: syntax error, unexpected '=' in lib/admin/dataUpdater.php on line 22

$query = "UPDATE global_settings SET ';foreach($vars as $eachValue){	$parsedValue = explode('=',$eachValue);	$query += $parsedValue[0] . "='" . $parsedValue[1] . "', ";}$query += "WHERE id=0";

Line 22: $query += $parsedValue[0] . "='" . $parsedValue[1] . "', ";I have even tried:

$query += $parsedValue[0] . "\='" . $parsedValue[1] . "', ";

and i getWarning: Unexpected character in input: '\' (ASCII=92) state=1 in lib/admin/dataUpdater.php on line 22Parse error: syntax error, unexpected '=' in lib/admin/dataUpdater.php on line 22Any idea because im stumped :)

Link to comment
Share on other sites

$query = "UPDATE global_settings SET ';
you missed a quote here..single and double quote missed match.i think you want to concatenate strings instead of adding it. you need to use '.=' instead of '+='
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...