Hi, i have four forms type that use the same insert method, here it is the scenario:
way 1:
-name
-age
-home dir
-ID
way2:
-name
-work dir
way 3:
-name
-id
-sex
way 4:
-name
-id
-sex
-home dir
-work dir
as you can see, not all ways use all database fields, this application will be used by one hundred users, so, thinking in the fastest way and performance for LAMP, what should be the best way to code the insert?
way 1:
$xway=$_POST["txtway"];
$xname=$_POST["name"];
if($xway=="02" || $xway=="04"){
$xworkdir=$_POST["workidr"];
}
if($xway=="03" || $xway=="04"){
$xsex=$_POST["sex"];
}
insert into $table() values()....
or this:
way 2
$xway=$_POST["txtway"];
$xname=$_POST["name"];
$xworkdir=$_POST["workidr"]; //might be null in some cases
$xsex=$_POST["sex"]; //might be null in some cases
insert into....
i want to now between way1 or way2 what it is the best way to do the insert without to overload apache2 and php in evaluating or not possible values
thanks for our replies
merry christmas