$array['a']['b']=50;
mysql_query("update table set name=name-$array['a']['b']");
It show's error. Why it is not working? How fix it?
Thanks
$array['a']['b']=50;
mysql_query("update table set name=name-$array['a']['b']");
It show's error. Why it is not working? How fix it?
Thanks
PHP's parser is not "greedy".
echo "$arr[a][b]"
is actually parsed as if it was:
echo $arr['a'];
echo '[b]';
and would produce as output
Array[b]
You need to use the {}
notation for this to work as you've written it:
mysql_query("update table set name=name-{$array['a']['b']}");
^-- ^--