Data problem

Jeffrey Maitland maitj at
Wed Dec 15 16:28:24 CET 2004

Hello all,

I am using the MySQLdb module and I am writing to a MySQL database. 

My write statement is something like.

cursor.execute("INSERT INTO Data(Name, X, Y, Z, Data) 

                       VALUES('%s', '%s', '%s', '%f', '%f', '%f',
'%s')""" % 

                                   (name, high_x, high_y, high_z, data))


I can write the data to a file as a check and all  variables are showing
correctly. However when I extract the data from the database the X, Y
are not coming out with the same number that "should be going" into the
database but the Z is.  Any Ideas?


Example data going in and out.


Name = test

X = 34.523

Y = -123.2432

Z =  -123.2346

Data = "This is test data"



Name = test

X = 34.0

Y = -123.0

Z =  -123.2346

Data = "This is test data"


That's is what is going in and coming out. 

*Note this is an example of the data not actual data or code (Although
the difference is the amount of data being input)"


Thanks for any and all help/comments.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list