PHP gevorderde |
|
if(isset($_POST['submit']))
{
$carrier_id=$_POST['id'];
if ($carrier_id <= 20000){
$tabel = "carrier1";
}
if ($carrier_id > 20000 && $carrier_id <= 40000){
$tabel = "carrier2";
}
if ($carrier_id > 40000 && $carrier_id <= 60000){
$tabel = "carrier3";
}
if ($carrier_id > 60000 && $carrier_id <= 80000){
$tabel = "carrier4";
}
if ($carrier_id > 80000){
$tabel = "carrier5";
}
$aantal = $_POST['aantal'];
$rest = substr ($carrier_id, 1);
mysql_query("UPDATE ".$tabel." SET gescand = ".(1)." WHERE carrier_id = $rest")or die(mysql_error());
}else{
if(isset($_POST['submit'])) { $carrier_id=$_POST['id']; if ($carrier_id <= 20000){ $tabel = "carrier1"; } if ($carrier_id > 20000 && $carrier_id <= 40000){ $tabel = "carrier2"; } if ($carrier_id > 40000 && $carrier_id <= 60000){ $tabel = "carrier3"; } if ($carrier_id > 60000 && $carrier_id <= 80000){ $tabel = "carrier4"; } if ($carrier_id > 80000){ $tabel = "carrier5"; } $aantal = $_POST['aantal']; $rest = substr ($carrier_id, 1); }else{
Al snap ik hier het nut niet van in. Mysql moet handig 40.000 records kunnen hanteren.. dus mag ik vragen waarom je dit wilt doen? |