Erreur MySQL (insert into, je déserpère...)

Résolu/Fermé
Squad-G - 3 juil. 2008 à 19:15
 Squad-G - 3 juil. 2008 à 23:29
Bonjour,

Alors voilà. J'ai une requête MySQL qui insert seulement des 0 dans ma base de données donc :

Id Title File_Name Categories Resolution ResolutionCustom Description byWho AddedTime Hash
6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... enfin, vous comprenez ce que je veux dire j'espère.

Enfin bref, voica ma requête :
NSERT INTO `hdpapers_db` . `Admin_Upload` (`Id` , `Title` , `File_Name` , `Categories` , `Resolution` , `Description` , `byWho` , `AddedTime` , `Hash`) VALUES (NULL , `Title` = 'gdfgdf' , `File_Name` = '/tmp/phpDvukNS-Sans titre.png' , `Categories` = '1;2;5' , `Resolution` = '1600x1200' , `Description` = 'fdsfsfsd' , `byWho` = 1 , `AddedTime` = 1215104964 , `Hash` = '7497a000ef5bd0cc51ee7b10a2913b95')

Obtenu via :

$Sql_Query_Info = '';
$Sql_Query = '';

$Sql_Query_Info[] = '`Id`';
$Sql_Query[] = 'NULL';

$Sql_Query_Info[] = '`Title`';
$Sql_Query[] = '`Title` = \'' . $Wall_Title . '\'';

$Sql_Query_Info[] = '`File_Name`';
$Sql_Query[] = '`File_Name` = \'' . $Wall_File_Final_Name . '\'';

$Sql_Query_Info[] = '`Categories`';
$Sql_Query[] = '`Categories` = \'' . $Wall_Categories_All . '\'';

if($Resolution_Alternatif == false)
{
$Sql_Query_Info[] = '`Resolution`';
$Sql_Query[] = '`Resolution` = \'' . $Wall_Resolution . '\'';
}
else
{
$Sql_Query_Info[] = '`ResolutionCustom`';
$Sql_Query[] = '`ResolutionCustom` = \'' . $Wall_Resolution_SiA1 . 'x' . $Wall_Resolution_SiA2 . '\'';
}
$Sql_Query_Info[] = '`Description`';
$Sql_Query[] = '`Description` = \'' . $Wall_Description . '\'';

$Sql_Query_Info[] = '`byWho`';
$Sql_Query[] = '`byWho` = ' . $Wall_byWho;

$Sql_Query_Info[] = '`AddedTime`';
$Sql_Query[] = '`AddedTime` = ' . time();

$Sql_Query_Info[] = '`Hash`';
$Sql_Query[] = '`Hash` = \'' . md5 ( time() . $Wall_Title . $_User['Id'] . ($Resolution_Alternatif == false ? $Wall_Resolution : $Wall_Resolution_SiA1 . 'x' . $Wall_Resolution_SiA2) ) . '\'';

// -------------------------------------------------------------- --------------------------------------------------------------

$Sql_Query_Insert_Info = '';
$Sql_Query_Insert = '';

$Sql_Query_Total_Info = count($Sql_Query_Info);
$Sql_Query_Total = count($Sql_Query);

$Sql_Query_Count_Info = 0;
$Sql_Query_Count = 0;

foreach($Sql_Query as $Sql_Query_Data){
$Sql_Query_Insert .= $Sql_Query_Data . ($Sql_Query_Total == ($Sql_Query_Count + 1) ? '' : ' , ');
$Sql_Query_Count++;
}
foreach($Sql_Query_Info as $Sql_Query_Data_Info){
$Sql_Query_Insert_Info .= $Sql_Query_Data_Info . ($Sql_Query_Total_Info == ($Sql_Query_Count_Info + 1) ? '' : ' , ');
$Sql_Query_Count_Info++;
}

// -------------------------------------------------------------- --------------------------------------------------------------

echo ( 'INSERT INTO `hdpapers_db` . `Admin_Upload` (' . $Sql_Query_Insert_Info . ') VALUES (' . $Sql_Query_Insert . ')' );
die;
QuerySQL ( 'INSERT INTO `Admin_Upload` (' . $Sql_Query_Insert_Info . ') VALUES (' . $Sql_Query_Insert . ')' ) or QueryError ( __LINE__ , __FILE__ , true );
move_uploaded_file( $Wall_File_Temp_Name , 'admin/' . $Wall_File_Final_Name );


PS : Je sais ya un echo et die, c'était pour faire afficher sur ma page, mais si j'enlève sa la requête ajoute des 0 dans la BBD... quelqu'un pour aider SVP ? Merci
A voir également:

2 réponses

up
0
Oh my god, omg laissé faire j'ai trouvé, tellement stupide... des Colonne = Value dans VALUES >_<' OMG sorry lol
0