PHP interesse |
|
Momenteel krijg ik steeds de volgende foutmelding:
Foutje: 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 '[users] SET lang='en' WHERE `login`='admin' AND `gameid`= 59' a
Foutje : 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 '[users] SET lang='en ' WHERE `login`='admin ' AND `gameid`= 59' a
Mijn database en het deel wat veranderd dient te worden is:
[users] en de tabel; lang
Dit is mijn script:
<?php /* ------------------------- */
$UPDATE_DB = 1;
if(! check_login()) {
header("Location: ".$site_url."?pagina=home");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}' AND `gameid`= {$_SESSION['gid']} ");
content_begin();
if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
//update layout
if( mysql_query("UPDATE [users] SET lang='".mysql_escape_string($_POST['lang'])."' WHERE `login`='{$data->login}' AND `gameid`= {$_SESSION['gid']} ") ) {
echo "Taal verandert! Ga opnieuw naar uw website adres vanaf de startpagina om te activeren.";
} else {
echo "Foutje: ". mysql_error();
}
}//einde verwerking
#
$select = mysql_query("SELECT * FROM `[users]`");
#
$page = mysql_fetch_object($select);
?>
<?php /* ------------------------- */ $UPDATE_DB = 1; if(! check_login()) { header("Location: ".$site_url."?pagina=home"); } mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}' AND `gameid`= {$_SESSION['gid']} "); content_begin(); if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { //update layout if( mysql_query("UPDATE [users] SET lang='".mysql_escape_string($_POST['lang'])."' WHERE `login`='{$data->login}' AND `gameid`= {$_SESSION['gid']} ") ) { echo "Taal verandert! Ga opnieuw naar uw website adres vanaf de startpagina om te activeren."; } else { } }//einde verwerking # # ?>
Het deel wat zoiezo zonder problemen werkt is:
$UPDATE_DB = 1;
if(! check_login()) {
header("Location: ".$site_url."?pagina=home");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}' AND `gameid`= {$_SESSION['gid']} ");
content_begin();
$UPDATE_DB = 1; if(! check_login()) { header("Location: ".$site_url."?pagina=home"); } mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}' AND `gameid`= {$_SESSION['gid']} "); content_begin();
Hopende dat iemand mij hier verder mee kan helpen.
|