Setting SQLAlchemy autoincrement start value

You can achieve this by using DDLEvents. This will allow you to run additional SQL statements just after the CREATE TABLE ran. Look at the examples in the link, but I am guessing your code will look similar to below: from sqlalchemy import event from sqlalchemy import DDL event.listen( Article.__table__, “after_create”, DDL(“ALTER TABLE %(table)s AUTO_INCREMENT … Read more

PHP mySQL – Insert new record into table with auto-increment on primary key

Use the DEFAULT keyword: $query = “INSERT INTO myTable VALUES (DEFAULT,’Fname’, ‘Lname’, ‘Website’)”; Also, you can specify the columns, (which is better practice): $query = “INSERT INTO myTable (fname, lname, website) VALUES (‘fname’, ‘lname’, ‘website’)”; Reference: http://dev.mysql.com/doc/refman/5.6/en/data-type-defaults.html