在mysql中插入数据[关闭]

I would like to know how I can insert only in a particular column in mysql database?

I have 12 fields or column in my database. I would like to insert a data only in the last column. How can I do this in PHP?

Use an INSERT statement that only has this one column listed. Whether that will work depends on the definition of the columns in the table. It may be that certain other columns are "required"

You just need to specify the name of the last column, eg

INSERT INTO tableName(colName) VALUES (val1)
INSERT INTO table_name ( field1 )
                   VALUES
                   ( value1 );

You can do it with SQL.

INSERT INTO TABLE_NAME (COLUMN_NAME, COLUMN_NAME2) VALUES (VALUE_OF_PHP, VALUE_OF_PHP_2)