jesushax Posted March 23, 2009 Share Posted March 23, 2009 hi all, below is my code what i want to be able to do is to exclude certain fields from the form being put in the below array, is there a way to do this? Thanks foreach($_POST as $key=>$value) $SQL = "INSERT INTO tblDirectory2 ("; foreach($_POST as $key=>$value){ $SQL .= "$key, "; } $SQL = rtrim($SQL,', '); $SQL .=") VALUES ("; foreach($_POST as $key=>$value){ $SQL .= "'$value', "; } $SQL = rtrim($SQL,', '); $SQL .=")"; Link to comment https://forums.phpfreaks.com/topic/150717-solved-exclude-fields-from-this-array/ Share on other sites More sharing options...
waynew Posted March 23, 2009 Share Posted March 23, 2009 Maybe create an array of the fields that you don't want included and then check it that way using in_array() ??? Link to comment https://forums.phpfreaks.com/topic/150717-solved-exclude-fields-from-this-array/#findComment-791775 Share on other sites More sharing options...
jesushax Posted March 23, 2009 Author Share Posted March 23, 2009 can you show me? im not that familiar with using arrays yet thanks Link to comment https://forums.phpfreaks.com/topic/150717-solved-exclude-fields-from-this-array/#findComment-791792 Share on other sites More sharing options...
jesushax Posted March 23, 2009 Author Share Posted March 23, 2009 anyone? Link to comment https://forums.phpfreaks.com/topic/150717-solved-exclude-fields-from-this-array/#findComment-791835 Share on other sites More sharing options...
jesushax Posted March 23, 2009 Author Share Posted March 23, 2009 found answer here http://tech.petegraham.co.uk/2007/03/22/php-remove-values-from-array/ Link to comment https://forums.phpfreaks.com/topic/150717-solved-exclude-fields-from-this-array/#findComment-791859 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.