Jump to content

[SOLVED] exclude fields from this array


jesushax

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.