mysqldb SELECT COUNT reurns 1

SMALLp pofuk at mzm.hr
Thu Dec 27 15:03:43 EST 2007


Hy! I nave another problem I can't solve!
<code>

	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["passwd"],
db=connectionString["db"])		

cursor = conn.cursor()
sql = "SELECT COUNT(*) FROM " + dataTable
res = cursor.execute(sql)
print res

<code>
It prints 1, and there are 88 rows in table. SELECT works fine, but 
SELECT COUNT(*) makes problems.

Help! Thanks in advance!



More information about the Python-list mailing list