wiley_pastebin icon

1.4 SQL1

wiley_pastebin | PRO | 11/18/19 08:22:32 AM UTC | 0 ⭐ | 7835 👁️ | Never ⏰ | []
SQL |

480 B

|

None

|

0 👍

/

0 👎

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.

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎