I am trying to use a 2 dimensional array and can't seem to find the right way to populate it. When I try to print the contents I get Array[0] Array[1] and so on.
Am I missing something?
function add_weight($weight1, $weight2, $size){
$strFind[0][0] = "Like '%80%socket%fixed%aux. cont%'";
$strFind[0][1] = "Like '%80%socket%separate%aux. cont%'";
$strFind[0][2] = "Like '%80%socket%fixed%Pilot%'";
$strFind[0][3] = "Like '%80%socket%separate%Pilot%'";
$strFind[1][0] = "Like '%80%plug%fixed%aux. cont%'";
$strFind[1][1] = "Like '%80%plug%separate%aux. cont%'";
$strFind[1][2] = "Like '%80%plug%fixed%Pilot%'";
$strFind[1][3] = "Like '%80%plug%separate%Pilot%'";
$weight = array('\0');
$weight[0] = "tblRema.fldWeight = $weight1";
$weight[1] = "tblRema.fldWeight = $weight2";
$i1 = 0;
$i2 = 0;
$rows = 0;
mysql_connect("XXXX", "XXXX", "XXXX");
mysql_select_db("XXXXX");
for($i2=0; $i2<2; ++$i2){
for($i1=0; $i1<5; ++$i1){
$strSQL="UPDATE tblRema INNER JOIN tblPrice ON tblRema.fldGroupMarker = tblPrice.fldPartNo SET $weight[$i2]
WHERE (((tblRema.fldDescription) $strFind[$i2][$i1] AND ((tblPrice.fldSize) Like '%$size%'))";
mysql_query($strSQL);
$rows = mysql_affected_rows();
print("$rows $strFind[$i2][$i1] $weight[$i2]<br />\n");
}
}
mysql_close();
}
add_weight(4, 4.5, '16');