J'utilise les fonctions Dreamweaver pour mettre à jour des enregistrement dans des tables Joomla, sur 12 tables, donc 12 pages, il y en a une qui me produit un erreur mysql alors qu'elle est conçue exactement comme les autres. Je suppose que le contenu des champs ne doit pas lui convenir, mais je ne sais pas quoi...
l'erreur :
le code de mise à jour :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 'fulltext=NULL, images='IMAGES/femme005.gif', catid=8, `alias`='latelier', title_' at line 1
Code : Tout sélectionner
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE jos_content SET title=%s, introtext=%s, fulltext=%s, images=%s,
catid=%s, `alias`=%s, title_alias=%s, `state`=%s, sectionid=%s, mask=%s, created=%s,
created_by=%s, created_by_alias=%s, modified=%s, modified_by=%s, checked_out=%s, checked_out_time=%s, publish_up=%s, publish_down=%s, urls=%s, attribs=%s, version=%s,
parentid=%s, ordering=%s, metakey=%s, metadesc=%s, `access`=%s, hits=%s, metadata=%s
WHERE id=%s",
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['introtext'], "text"),
GetSQLValueString($_POST['fulltext'], "text"),
GetSQLValueString($_POST['images'], "text"),
GetSQLValueString($_POST['catid'], "int"),
GetSQLValueString($_POST['alias'], "text"),
GetSQLValueString($_POST['title_alias'], "text"),
GetSQLValueString($_POST['state'], "int"),
GetSQLValueString($_POST['sectionid'], "int"),
GetSQLValueString($_POST['mask'], "int"),
GetSQLValueString($_POST['created'], "text"),
GetSQLValueString($_POST['created_by'], "int"),
GetSQLValueString($_POST['created_by_alias'], "text"),
GetSQLValueString($_POST['modified'], "text"),
GetSQLValueString($_POST['modified_by'], "int"),
GetSQLValueString($_POST['checked_out'], "int"),
GetSQLValueString($_POST['checked_out_time'], "date"),
GetSQLValueString($_POST['publish_up'], "text"),
GetSQLValueString($_POST['publish_down'], "text"),
GetSQLValueString($_POST['urls'], "text"),
GetSQLValueString($_POST['attribs'], "text"),
GetSQLValueString($_POST['version'], "int"),
GetSQLValueString($_POST['parentid'], "int"),
GetSQLValueString($_POST['ordering'], "int"),
GetSQLValueString($_POST['metakey'], "text"),
GetSQLValueString($_POST['metadesc'], "text"),
GetSQLValueString($_POST['access'], "int"),
GetSQLValueString($_POST['hits'], "int"),
GetSQLValueString($_POST['metadata'], "text"),
GetSQLValueString($_POST['id'], "int"));
mysql_select_db($database_CnxOrigines, $CnxOrigines);
$Result1 = mysql_query($updateSQL, $CnxOrigines) or die(mysql_error());
}
mysql_select_db($database_CnxOrigines, $CnxOrigines);
$query_RecListeCateg = "SELECT jos_categories.id, jos_categories.title FROM jos_categories WHERE jos_categories.ordering < 11 ORDER BY jos_categories.ordering ASC";
$RecListeCateg = mysql_query($query_RecListeCateg, $CnxOrigines) or die(mysql_error());
$row_RecListeCateg = mysql_fetch_assoc($RecListeCateg);
$totalRows_RecListeCateg = mysql_num_rows($RecListeCateg);
mysql_select_db($database_CnxOrigines, $CnxOrigines);
$query_RecUneCateg = "SELECT * FROM jos_content WHERE jos_content.catid='$id' ";
$RecUneCateg = mysql_query($query_RecUneCateg, $CnxOrigines) or die(mysql_error());
$row_RecUneCateg = mysql_fetch_assoc($RecUneCateg);
$totalRows_RecUneCateg = mysql_num_rows($RecUneCateg);
?>Dans le contenu des champs, il y a des textes, des dates, des "=", des chemins vers des images, et des entiers.
Alors serait-ce les "/" des chemins qu'il n'aime pas ou bien les "=" ?
Merci d'avance pour votre aide.