Re: mysqldb SELECT COUNT reurns 1

2008-01-09 Thread mike
On Dec 27 2007, 5:25 pm, Ian Clark <[EMAIL PROTECTED]> wrote: > On 2007-12-27, SMALLp <[EMAIL PROTECTED]> wrote: > > > connectionString = {"host":"localhost", "user":"root", > > "passwd":"pofuck", "db":"fileshare"} > > dataTable = "files" > > conn = mysql.connect(host=connectionString["host"], > >

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread Ian Clark
On 2007-12-27, SMALLp <[EMAIL PROTECTED]> 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=conn

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread John Machin
On Dec 28, 7:03 am, SMALLp <[EMAIL PROTECTED]> wrote: > Hy! I nave another problem I can't solve! > > > import MySQLdb as mysql > > connectionString = {"host":"localhost", "user":"root", > "passwd":"pofuck", "db":"fileshare"} > dataTable = "files" > conn = mysql.connect(host=connectionStri

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread SMALLp
Rob Williscroft wrote: > SMALLp wrote in news:[EMAIL PROTECTED] in comp.lang.python: > >> Hy! I nave another problem I can't solve! >> >> >> import MySQLdb as mysql > >> cursor = conn.cursor() >> sql = "SELECT COUNT(*) FROM " + dataTable >> res = cursor.execute(sql) > > I think you need to

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread Rob Williscroft
SMALLp wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Hy! I nave another problem I can't solve! > > > import MySQLdb as mysql > cursor = conn.cursor() > sql = "SELECT COUNT(*) FROM " + dataTable > res = cursor.execute(sql) I think you need to do: res = cursor.fetchone()[0] > pri

mysqldb SELECT COUNT reurns 1

2007-12-27 Thread SMALLp
Hy! I nave another problem I can't solve! import MySQLdb as mysql connectionString = {"host":"localhost", "user":"root", "passwd":"pofuck", "db":"fileshare"} dataTable = "files" conn = mysql.connect(host=connectionString["host"], user=connectionString["user"], passwd=connectionString["p