[SOLVED] Store number of rows in mysql data in variable


SELECT COUNT( *) as "Number of Rows"
FROM orders;

i want to add "Number of rows" into a python variable but idk how.


stored numbers of rows in python variables

db= MySQLdb.connect("HOSTNAME", "USER_NAME", "PWD", "DB_NAME");
cursor= db.cursor();
number_of_rows = cursor.execute("SELECT COUNT (*) FROM TBL");

Answered By – Umair Mubeen

Answer Checked By – Robin (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *