I have populated an array using explode from a comma separated string variable. Now I need to access the data in the array.
I used:
print_r($values); // to see how the data was stored
//output
Array (
[0] => Array (
[0] => 1rv09is001
[1] => 07IS72 )
[1] => Array (
[0] => 1RV09IS064
[1] => 07IS72 )
)
I tried:
$a = count($values);
for($i;$i<$a;$i++){
$sql="UPDATE subject
SET attendance=attendance+1
WHERE usn=$values[$i][0] AND subCode=$values[$i][1]
";
echo "$sql";
mysql_query($sql);
}
It isn't working.
mysql_*functions are deprecated, use PDO ormysqli_*instead.