I've cust_name and install_no columns in table, each customer's name repeated 12 times as rows how to insert numbers 1 to 12 in install_no column for all rows.
table sample:
-----------------------------
cust_name | install_no
----------------------------
ROGER | 1
----------------------------
ROGER | 2
----------------------------
ROGER | 3
----------------------------
ROGER | 4
----------------------------
ROGER | 5
----------------------------
ROGER | 6
----------------------------
ROGER | 7
----------------------------
ROGER | 8
----------------------------
ROGER | 9
----------------------------
ROGER | 10
----------------------------
ROGER | 11
----------------------------
ROGER | 12
----------------------------
JAMES | 1
----------------------------
JAMES | 2
----------------------------
JAMES | 3
----------------------------
JAMES | 4
----------------------------
JAMES | 5
----------------------------
JAMES | 6
----------------------------
JAMES | 7
----------------------------
JAMES | 8
----------------------------
JAMES | 9
----------------------------
JAMES | 10
----------------------------
JAMES | 11
----------------------------
JAMES | 12
----------------------------
$b = array(0 => '1', 1 => '2', 2 => '3', 3 => '4', 4 => '5', 5 => '6', 6 => '7', 7 => '8', 8 => '9', 9 => '10', 10 => '11', 11 => '12'); //pre-defined installment numbers
$string = "";
foreach($b as $k => $v)
{
$string = "UPDATE bijapur_slabpay SET install_no = $v WHERE install_no=''";
mysql_query($string);
}