<div class="gmail_quote">On Thu, May 20, 2010 at 12:56 PM, MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com">python@mrabarnett.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br></div></div>
When performing SQL operations, don't insert the values using Python's<br>
string formatting, because that makes it vulnerable to SQL-injection<br>
attacks, ie don't do this:<br>
<br>
    cursor.execute(sql_command % values)<br>
<br>
do this:<br>
<br>
    cursor.execute(sql_command, values)</blockquote><div><br>Oh, thank you! <br></div><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">I think you need to 'commit' any changes to do to the database.<br></div></blockquote><div><br>Caught by the commit again. Yes, thanks.<br>beno<br></div></div><br>