Je continue à recevoir le message d'erreur suivant lorsque vous essayez de mettre à jour un de mes tables de base de données:Génération SQL avec sprintf(): "Trop peu d'arguments"
idrr = 167
age_notes = 'Enumerate, Louisvilleluminary, Nacho Friend, Bulls and Bears, Bricklayer, Activity Report, Interactif, Soundman).\r\n
\r\nBashford Manor S (gr-III, 6f, defeating Flatter Than Me, Brassy Boy, Grand Slam Andre, Soundman, Westrock Gold, Vito Filitto, Even Wilder).\r\n
\r\nA maiden special weight race at Churchill Downs (5f, by 2 3/4, defeating Thiskyhasnolimit, Red Rally, Dublin, Criminal Offense, Congar, Horst, Prospective Union, Victorystart, Harley\'s Heat).'
Attention: sprintf() [function.sprintf] : Trop peu d'arguments dans /data/19/1/60/63/1875552/user/2038041/htdocs/vinery/Admin/upload_stallion.php en ligne 305 requête a été vide
juste au-dessus l'avertissement est un écho des deux variables utilisées dans le sprintf()
.
Voici la section de mon fichier php:
$idrr = GetSQLValueString($_POST['id1'], "int");
$associated_horse = GetSQLValueString($_POST['associated_horse1'], "int");
$year = GetSQLValueString($_POST['year1'], "text");
$age = GetSQLValueString($_POST['age1'], "int");
$starts = GetSQLValueString($_POST['starts1'], "int");
$first = GetSQLValueString($_POST['first1'], "int");
$first_sw = GetSQLValueString($_POST['first_sw1'], "int");
$second = GetSQLValueString($_POST['second1'], "int");
$second_sp = GetSQLValueString($_POST['second_sp1'], "int");
$third = GetSQLValueString($_POST['third1'], "int");
$third_sp = GetSQLValueString($_POST['third_sp1'], "int");
$age_notes = GetSQLValueString($_POST['age_notes1'], "text");
$age_text = GetSQLValueString($_POST['age_text1'], "text");
$earned = GetSQLValueString($_POST['earned1'], "text");
echo ("idrr = " . $idrr . "<br/>");
echo ("age_notes = " . $age_notes);
$insertSQL = sprintf("UPDATE race_records SET age_notes = $age_notes WHERE rr_id = %s", GetSQLValueString($idrr, "int"));
mysql_select_db($database_XXXXXX, XXXXXX);
$Result = mysql_query($insertSQL, $HDAdave) or die(mysql_error())
Je ne peux pas comprendre pourquoi ce travail particulier wont UPDATE. Quelqu'un peut-il voir ce que je fais mal?
Cela ne va pas aider avec l'erreur 'sprintf()' cependant. –
Ajout d'un écho GetSQLValueString ($ _ POST ['id1'], "int"); et placez '' autour de 'age_notes' et de% s. – user1028866
La réponse est maintenant: – user1028866