'lo.. Is het ook mogelijk om iets te inserten in twee tables?
Dus zoiets als dit (alleen werkt dit dus niet):
INSERT INTO table1,table2 SET title = 'test';
790 views
Sure it can be done! You just need to build your mysql query accordingly.
<?
$query = "insert into my_table (id, val1, val2) VALUES ('', '$form_val1', '$form_val2');
insert into my_other_table (id, val3, val4) VALUES ('', '$form_val3', '$form_val4');";
mysql_query($query);
?>
I hope that makes sense to you. You basically do two inserts and use the posted variables in each IMSERT accordingly.