i have been scouring the internet lately trying to look for an answer to my question, but im at a loss, i kno whteres a way of doing what i want, im just not sure how to go about it.
so here goes, i hope somebody out there can help...
my question is how do i go about making one fnction which inserts posted values into a database, im sick of writin gth esame code over and over and just chnaging the values of the form,
this is what i have atm...
Code: Select all
$sql = "INSERT INTO $table (first,second,company,home,mobile,fax,email,address,comments) VALUES
('$first', '$second', '$company', '$home', '$mobile', '$fax', '$email', '$address', '$comments')";
}
$result = mysql_query($sql);
echo "You have added that record! ";
//end codeisnt the a way for example of doing it this way...
Code: Select all
$sql = "INSERT INTO $table ($names) VALUES ('$values')";
}
$result = mysql_query($sql);
echo "You have added / edited that record!";help would be really appreciated.
phase