Basically, I have a PHP class for generic SQL statements:
-
object.table('table_name')fills an array with the column names for'table_name'pulled out of the table_schema -
object.insert(data_array)runs an insert statement into'table_name'using the column array and the data_array -
object.select('where')returns everything in'table_name'using a where statement input or nothing at all
I did this because i’m lazy and I wanted to make my code prettier. However, the schema lookup returns the ID columns from my tables, which is fine because sometimes I need it returned with object.select(). However, it makes object.insert() kinda difficult.
Is there some SQL functionality I don’t know about that allows you to insert into an auto incrememented column accurately or is there a more simple solution right in front of my eyes and I’m just being a complete moron.
Auto incremented columns cannot be inserted into. You can perform your insert (bypassing the auto-incremented field) and just accept the automatically-generated id…