Bonjour,
je cherche, je cherche mais ne trouve pas ! Pouvez vous me rendre service concernant cette erreur sql qui m'embete un peu ! Merci d'avance !
fonction transfert !!
function transfert ()
{
$ret = false;
$img_blob = '';
$img_taille = 0;
$img_type = '';
$img_nom = '';
$taille_max = 250000;
$ret = is_uploaded_file ($_FILES['fic']['tmp_name']);
if ( !$ret )
{
echo "Problème de transfert";
return false;
}
else
{
// Le fichier a bien été reçu
$img_taille = $_FILES['fic']['size'];
if ( $img_taille > $taille_max )
{
echo "Trop gros !";
return false;
}
$img_type = $_FILES['fic']['type'];
$img_nom = $_FILES['fic']['name'];
$desc = $_POST['desc'];
$tarifs = $_POST['tarifs'];
include('config.php');
$img_blob = file_get_contents ($_FILES['fic']['tmp_name']);
$sql2 = "UPDATE images SET desc = '".$desc."' AND tarifs = '".$tarifs."' AND img_nom = '".$img_nom."' AND img_taille = '".$img_taille."' AND img_type = '".$img_type."' AND img_blob = addslashes (".$img_blob.") ";
$result2 = mysql_query($sql2) or die( "Erreur !!!!!! : " . mysql_error() );
return true;
}
}
L'erreur résultante est la suivante :
Erreur !!!!!! : 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 'desc = 'fv' AND tarifs = 'fv' AND img_nom = 'bordeaux_imprimer.gif' AND img_tail' at line 1
Merci beaucoup
Configuration: Windows XP
Internet Explorer 7.0