dzhax Posted May 5, 2011 Share Posted May 5, 2011 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 More sharing options...
birbal Posted May 5, 2011 Share Posted May 5, 2011 $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 More sharing options...
dzhax Posted May 5, 2011 Author Share Posted May 5, 2011 that did the trick. i knew a new set of eyes would work. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.