title: sprintf and % signs in text
body: <p>A problem I recently ran into was that when trying to update a field in my database using this code would not work. I traced it back to having a <code>%</code> sign in the text being updated (<code>$note</code>, then <code>$note_escaped</code>)... Inserting it with <code>sprintf</code> worked fine though.</p>
  <p>Should I not be using <code>sprintf</code> for updates, or should it be formed differently?</p>
  <p>I did some searching but couldn't come up with anything.</p>
  <pre><code>$id = mysql_real_escape_string($id);
  $note_escaped = mysql_real_escape_string($note);
  $editedby = mysql_real_escape_string($author);
  $editdate = mysql_real_escape_string($date);
  //insert info from form into database
  $query= sprintf(&quot;UPDATE notes_$suffix SET note='$note_escaped', editedby='$editedby', editdate='$editdate' WHERE id='$id' LIMIT 1&quot;);
  </code></pre>