473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Quering Mysql Databases

Hi am new to python,
am trying fetch data from mysql DB and need to manipulated it.
the data type of Output query is tuple but i need it in int to perform arithmetic operation. kindly suggest.

cursor = cnx.cursor()
cursor.execute("SELECT mobileno FROM mobile")
rows = cursor.fetchall()
print('Total Row(s):', cursor.rowcount)
for row in rows:
print(type(row[0]))
Nov 27 '16 #1
1 1251
dwblas
626 Expert 512MB
See Harry George's answer at https://bytes.com/topic/python/answe...46-typecasting
Nov 27 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Joshua Beall | last post by:
Hi All, I am working on a registration system, and one of the things I am going to need to be able to do it setup the database tables for each event that I have registration for. Normally I...
2
by: Thomas Bartkus | last post by:
Is it safe to say that restoring the directory from a backup would that restore all database data and structure? All usr/pwd and GRANT info? Thomas Bartkus
1
by: vineyard_saker | last post by:
Hi, I am new to MySql and I want to practice querying by playing around a relatively large and complex database without having to enter all the data myself. Is there a publicly available MySql...
2
by: shoa | last post by:
Hello I have an Access database that is used for a station computer. Now I want to update this database for a small network for about 4 computers (to share this database). I know that I can link...
9
by: noor.rahman | last post by:
I was wondering how it may be possible to query 2 MySQL databases using one query statement from PHP. For instance: SELECT database1.tableA.field1 UNION database2.tableB.field2. My concern...
1
by: David | last post by:
Hi All, I'm having trouble accessing multiple databases using a single user. Basically, I have 2 databases, db1 and db2 and 2 users, user1 and user2. Originally these were setup so that user1...
4
by: Tracey | last post by:
I have a Mysql database hosted on a remote server. Previously, I could always connect to those databases using the 3.51 ODBC connector and linking the tables in Access. The benefit of this is that...
1
by: penny111 | last post by:
Hi there, I've migrated a database named "crime" from an MS Access database to MySQL 5.0.37 using the MySQL Migration Toolkit 1.1.11. What i want to do is to copy the database folder from ...
1
by: HSXWillH | last post by:
I have an Access 2003 db that I've designed to run inventory for a sports memorabilia business. I'm realizing that I should get this data onto the web and run a storefront via MySQL & PHP. My...
2
by: sandeep jahagir | last post by:
HI, I want to merge TESTLINK and BUGZILLA databases into one, even though they have mysql DB but i have installed in different ports(TESTLINK-3306 and BUGZILLA-3307). so with respect to TEST...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.