mysqldb SELECT COUNT reurns 1

mike cain171562 at gmail.com
Wed Jan 9 17:41:10 EST 2008


On Dec 27 2007, 5:25 pm, Ian Clark <icl... at mail.ewu.edu> wrote:
> On 2007-12-27, SMALLp <po... at mzm.hr> wrote:
>
> > connectionString = {"host":"localhost", "user":"root",
> > "passwd":"pofuck", "db":"fileshare"}
> > dataTable = "files"
> > conn = mysql.connect(host=connectionString["host"],
> > user=connectionString["user"], passwd=connectionString["passwd"],
> > db=connectionString["db"])
>
> Just to let you know, that last line can be rewritten as:
>
> conn = mysql.connect(**connectionString)
>
> Ian

Try using cursor.fetchall() instead of cursor.fetchone()



More information about the Python-list mailing list