bon, je pensais avoir passe le cap de la requete recalcitrante mais apparement je me trompais...
le soucis est le suivant:
j'ai installe tiny mce dans ma zone d'admin
dans admin.php j'affiche dans un textarea soit les infos
- "a propos de" ,
- "confidentialite"
- "termes et conditions"
le text area est editable via tiny mce pour la mise en page
j;envoi donc le contenu du textarea a admin.tpl.php qui traite l'info et mets a jour la table concernee.
les champs "tc", "confidentialite" et "apropos" sont des longtext
aucun probleme avec "apropos": j'affiche l'info dans admin.php, je traite dans admin.tpl.php et ca prends en compte les modifications de mise en page.
maintenant avec les termes et condition et le texte de confidentialite ca ne passe pas quand j'envois dans admin.tpl.php
ca me retourne une erreur du type:
Code : Tout sélectionner
Invalid query: 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 's principal servers are located. (iii) The Site allows you to enter competition' at line 1le texte est tres long (quelques pages sous word)
le contenu d'admin.tpl.php est le suivant:
<?php
session_start();
if (isset($_SESSION['level']) && $_SESSION['level'] == 2){}
else
{
$_SESSION['error'] = "3";
header('Location: ../../errors/error.php');
}
require("../../includes/config.php");
$case = (isset($_POST['case']))?$_POST['case']:'';
$tc = (isset($_POST['tc']))?$_POST['tc']:'';
$privacy = (isset($_POST['privacy']))?$_POST['privacy']:'';
$about = (isset($_POST['about']))?$_POST['about']:'';
switch($case)
{
//we're adding new FAQ content
case "1":
$query = "UPDATE admin SET tc = '$tc'";
mysql_query($query) or die ('Invalid query: ' . mysql_error());
//send the user back to the index page
header("Location: ../index.php");
exit();
break;
//update the position of the Q/A on the website
case "2":
$query = "UPDATE admin SET privacy = '$privacy'";
mysql_query($query) or die ('Invalid query: ' . mysql_error());
//send the user back to the index page
header("Location: ../index.php");
exit();
break;
//case where I update content of a specific Q/A (from edit_faq.php)
case "3";
$query = "UPDATE admin SET about = '$about'";
mysql_query($query) or die ('Invalid query: ' . mysql_error());
//send the user back to the index page
header("Location: ../index.php");
exit();
break;
//end Switch
}
?>
c'est plutot simple: une bete requete UPDATE...
si qq un a une idee de comment je peux regler ca ca serait sympa.
merci