Jump to content

[SOLVED] loop form values to add to datbase


jesushax

Recommended Posts

so this is how it works for updating  a table

 

$TSQL = "UPDATE tblDirectory SET";
foreach($_POST as $key => $value){
    $TSQL .= " $key='".mysql_real_escape_string($value)."', ";
}

 

how would we do it for adding?

 

no idea where to start here

or am i going to ahve to write out each variable?

 

Cheers

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.