Note that there are some explanatory texts on larger screens.

plurals
  1. POGenerating SQL with sprintf(): "Too few arguments"
    primarykey
    data
    text
    <p>I keep getting the following error message when trying to UPDATE one of my database tables:</p> <pre><code>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).' </code></pre> <p><strong>Warning: sprintf() [function.sprintf]: Too few arguments in /data/19/1/60/63/1875552/user/2038041/htdocs/vinery/Admin/upload_stallion.php on line 305 Query was empty</strong></p> <p>Right above the Warning is an echo of the two variables used in the <code>sprintf()</code>.</p> <p>Here is the section from my php file:</p> <pre><code> $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 . "&lt;br/&gt;"); 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()) </code></pre> <p>I can't figure out why this particular UPDATE wont work. Can anyone see what I'm doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload