Forum Moderators: coopster
$form=1;
if(count($_POST)){
$error = Add_Names();
if(empty($error))
$form=0;
}
$smarty->assign('Form', $form);
$smarty->display('admin_names_add.html');
function Add_Names(){
$q = "INSERT INTO sd_names(id,name) ".
" VALUES(NULL, '".mysql_escape_string($_POST['name'])."')";
// echo $q;
mysql_query($q);
}
OK, this works for entering all the names within the form but they all get inserted as one entry. How can I get each line within the form to be inserted as a separate entry with it's own auto-increment id?
Please be gentle as I really don't know what I'm doing but thought I may be able to hack this basic function together!