Forum Moderators: coopster
I'm using the foreach function to pass a multiple $_POST feilds, to a mysql db.
The problem is there are a couple of fields that i don't want to be passed into the db, i've done a bit of searching and found a few people suggest the unlink() function but i can't get that to work, so i was wondering if anybody knows if it is actually possible to remove specific $_POST variables from the array and if so, how do i go about doing it?
Failing that are there any better ways?
Many thanks,
Rob
unset($_POST['field1']); unset($_POST['field2']); unset($_POST['field3']);
Just one additional question, i seem to be getting a syntax problem:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'page_template VALUES ('three')' at line 1
I've tried to use the foreach option to update and insert data and i always seem to get his error on the last field. any ideas why?
If i post each value as a single post then the mysql will work fine, it just seems to be when i post the variables using foreach.
Thanks
Rob