I'm using php and mysqli. Can I do something like this:
$insertObject = new stdClass();
$insertObject->column_1 = "foo";
$insertObject->column_2 = "bar";
$mysqli->query("INSERT INTO `my_table` (`all_columns_at_once`) VALUES ('$insertobject')");
The reason I'm asking is because I'm using a webservice to let our apps access our database. One of our apps needs to insert a whole bunch of fields at once. There are about 30 columns in the table that need to be filled and to avoid having to fetch them all as separate values and create a giant query (which will be a pain to adjust in the future) I'd like to just send a json string to the webservice, create an object out of it and insert the entire object at once.