擅长:python、mysql、java
<p>来自<a href="http://www.kitebird.com/articles/pydbapi.pdf" rel="nofollow noreferrer">here (pdf)</a>:</p>
<blockquote>
<p>Following the statement string
argument to execute(), <strong>provide a tuple</strong>
containing the values to be bound to
the placeholders, in the order they
should appear within the string. If
you have only a single value x,
specify it as (x,) to indicate a
single-element tuple.</p>
</blockquote>
<p>日间;夜间:</p>
<pre><code>cursor.execute("""INSERT INTO life(user_id, utm)
values(%s,PointFromWKB(point(%s,%s)))""",
(the_user_id, utm_easting, utm_northing))
</code></pre>
<p>编辑:您也可以将列表作为<code>execute()</code>的第二个参数传递。在</p>
^{pr2}$