philihp.com

Tag: MySQL

How to retrieve the ID after a MySQL Insert in Python

The MySQLdb documentation mentions conn.insert_id(), however this appears to have been deprecated, maybe? This really should be on the cursor object anyway. And behold! There is a lastrowid on it! It’s just a little bit undocumented

Connecting to MySQL with PHP in Apache on OpenBSD

If you try to connect to MySQL with any scripting language running under Apache on OpenBSD, you’re liable to get the error: Can’t connect to local MySQL server through socket ‘/var/run/mysql/mysql.sock’ (2) This can be infuriating, since every setting is probably going to either still be the default setting, or be a correct setting; and [...]