<?php
// Strings DB
include ("NLconfig_db_update.php");
// connectie met de DB
$link = mysql_connect($dbhost, $dbuser, $dbpass) or die("<b>error</b>: failed to connect to database");
// Naam v/d DB
mysql_select_db($dbname);
$xml = simplexml_load_file('***.xml');
foreach($xml->product as $product){
//<name>
$xmlName = htmlentities(($product->name), ENT_QUOTES, 'UTF-8');
$fieldName = trim(html_entity_decode($xmlName));
//<productEvent>
$fieldEvent = $product->productEvent;
// MySQL
mysql_query ("UPDATE `".$mysql_table."` SET name = ".$fieldName." WHERE event = ".$fieldEvent." ")or die (mysql_error());;
}
echo "DATA UPDATED.";
mysql_close($link);
?>
Hij geeft deze fout!
-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 'XXX WHERE event = XXX' at line 1
350 views
knop om je tekst aan te passen.