Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import _mysql
- db = _mysql.CONNECT(”hostname”, ”username”, ”password”, ”DATABASE”)
- db.query('''CREATE TABLE IF NOT EXISTS users(id INTEGER PRIMARY KEY, name VARCHAR(255), email VARCHAR(255))''')
- IN python, no RETURN VALUE FROM query(), but exceptions possible.
- Results
- res = db.store_result() #held IN client
- res = db.use_result() #held IN server
- res.fetchrow(max_rows)
- res.fetchrow()
- fetchrow() will never RETURN more than max_rows. WITHOUT a parameter the NUMBER IS 1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement