J0kerz
07-23-2009, 11:44 AM
Hey guys,
I was wondering if there is a way to set the value in an INSERT statement, all to default except from the first value without having to write "DEFAULT" in each field.
Example: My table have 5 columns.
$query = "INSERT INTO test VALUES('username',DEFAULT,DEFAULT,DEFAULT,DEFAULT)";
I have multiple table in my DB, and I dont want to go edit the mysql statement everytime i add/remove a column in a table.
I thought of something that would count the column in a table and then generate a statement with the desire number of "DEFAULT" but I am sure there is a simple way...
Thanks guys! :D
I was wondering if there is a way to set the value in an INSERT statement, all to default except from the first value without having to write "DEFAULT" in each field.
Example: My table have 5 columns.
$query = "INSERT INTO test VALUES('username',DEFAULT,DEFAULT,DEFAULT,DEFAULT)";
I have multiple table in my DB, and I dont want to go edit the mysql statement everytime i add/remove a column in a table.
I thought of something that would count the column in a table and then generate a statement with the desire number of "DEFAULT" but I am sure there is a simple way...
Thanks guys! :D