I tried to venture off while following a python-flask tutorial and am having trouble figuring out an error. I tried browsing stack for 6 hours off and on and nothing out there related could help me out, possibly because I am a beginner...
I gathered data from a form (all the data is passing through fine, I tested by printing to the console) and want to insert it into a mysql table.
Here is the query code:
c.execute("INSERT INTO posts (post_count, seller, title, id, bus, condition, transType, post_description, trade, price) VALUES (%i, %s, %s, %s, %s, %s, %s, %s, %s, %i)", (thwart(postCount), thwart(seller), thwart(title), thwart(id), thwart(bus), thwart(condition), thwart(transType), thwart(description), thwart(tradeFor), thwart(price)))
The table description in MySql is:
+------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+-------------+------+-----+---------+----------------+
| post_id | int(11) | NO | PRI | NULL | auto_increment |
| post_count | int(11) | YES | | NULL | |
| seller | varchar(60) | YES | | NULL | |
| title | text | YES | | NULL | |
| id | varchar(25) | YES | | NULL | |
| bus | varchar(35) | YES | | NULL | |
| condition | varchar(20) | YES | | NULL | |
| transType | varchar(25) | YES | | NULL | |
| post_description | text | YES | | NULL | |
| trade | text | YES | | NULL | |
| price | int(11) | YES | | NULL | |
+------------------+-------------+------+-----+---------+----------------+
The error I keep getting is: must be string or read-only buffer, not long
I don't see where the long is coming from...Not sure what else you may need to help me out so ask if there's more info I can add.
much appreciated!