<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">On the following page:<div><br></div><div><a href="http://docs.python.org/2/library/sqlite3.html">11.13. sqlite3 — DB-API 2.0 interface for SQLite databases — Python v2.7.3 documentation</a></div><div><br></div><div>Search for  "fetchone"</div><div><br></div><div>the first match will take you to the following code:</div><div><br></div><div><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: rgb(238, 255, 204); color: rgb(51, 51, 51); line-height: 15px; border-top-width: 1px; border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-bottom-color: rgb(170, 204, 153); "><span class="c" style="color: rgb(64, 128, 144); font-style: italic; "># Do this instead</span>
<span class="n">t</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="p">(</span><span class="s" style="color: rgb(64, 112, 160); ">'RHAT'</span><span class="p">,)</span>
<span class="n">c</span><span class="o" style="color: rgb(102, 102, 102); ">.</span><span class="n">execute</span><span class="p">(</span><span class="s" style="color: rgb(64, 112, 160); ">'SELECT * FROM stocks WHERE symbol=?'</span><span class="p">,</span> <span class="n">t</span><span class="p">)</span>
<span class="k" style="color: rgb(0, 112, 32); font-weight: bold; ">print</span> <span class="n">c</span><span class="o" style="color: rgb(102, 102, 102); ">.</span><span class="n">fetchone</span><span class="p">()</span></pre><div>c however is a connection object, it does not contain 'fetchone'</div></div><div><br></div><div>I believe the author meant something like the following:</div><div><br></div><div><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: rgb(238, 255, 204); color: rgb(51, 51, 51); line-height: 15px; border-top-width: 1px; border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-bottom-color: rgb(170, 204, 153); "><span class="c" style="color: rgb(64, 128, 144); font-style: italic; "># Do this instead</span>
<span class="n">t</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="p">(</span><span class="s" style="color: rgb(64, 112, 160); ">'RHAT'</span><span class="p">,)</span>
<span class="n">cur = c</span><span class="o" style="color: rgb(102, 102, 102); ">.</span><span class="n">execute</span><span class="p">(</span><span class="s" style="color: rgb(64, 112, 160); ">'SELECT * FROM stocks WHERE symbol=?'</span><span class="p">,</span> <span class="n">t</span><span class="p">)</span>
<span class="k" style="color: rgb(0, 112, 32); font-weight: bold; ">print</span> <span class="n">cur</span><span class="o" style="color: rgb(102, 102, 102); ">.</span><span class="n">fetchone</span><span class="p">()</span></pre><div>Thank you!</div></div></body></html>