for ($x = 0; $x <= 3; $x++) {
for ($y = 0; $y <= 4; $y++) {
if ($y == 0) {
mysql_query("insert into tb_weight_rate_management
(nation,zone_id,rate) values ('Domestic',1,'$del_100')");
}
}
}
hello i am little troubled using for loop....in the code above i have two loops ...1st loop will work 3 times and the the inside loop will work 4 times.... now when i click on submit button then it checks loop one and then enter second loop and inserts data 4 times in the database....which is wrong...i want if $y=0; then it should insert data only once but it is inserting data 4 times can anyone please correct the above condition
if($y == 0 )ydoing here ? why are you creating a loop ? you just usingyONE TIME