#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    74
    Rep Power
    11

    MySQL Insert Help


    I am trying to insert data into my MySQL database nothing is happening. I can do a select fine and when I do my insert it returns a cursor.rowcount of 1, but when I look in the database I don't see my entry.

    cursor.execute("""INSERT into xyz (a,b,c,d) VALUES (%s,%s,%s,%s)""",(a_val,b_val,c_val,d_val) )

    One thing I notice is that I'm using %s for the values while some of the variables are integers, some are strings, and some are floats. I tried to use %d and %f for my ints and floats, but it balked at me.

    Any thoughts?

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    70
    Rep Power
    10
    what error report are you getting if you run from IDLE?
  4. #3
  5. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0

IMN logo majestic logo threadwatch logo seochat tools logo