View Single Post
Old 11-10-2005, 08:59 PM   #5
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
The $arrval['ID'] doesn't have a value because the $arrval array doesn't have an ID key. With the $arrval array set as follows:
Code:
$arrval = array(.01,101,202,303,404,5.05,6.06,7,8.08,9.09,10.1);
It is equivalent to the following:
Code:
$arrval = array(0 => .01, 1 => 101, 2 => 202, 3 => 303, 4 => 404, 5 => 5.05, 6 => 6.06, 7 => 7, 8 => 8.08, 9 => 9.09, 10 => 10.1);
You could set the array keys as follows:
Code:
$arrval = array("ID_0" => .01, "ID_1" => 101, "ID_2" => 202, "ID_3" => 303, "ID_4" => 404, "ID_5" => 5.05, "ID_6" => 6.06, "ID_7" => 7, "ID_8" => 8.08, "ID_9" => 9.09, "ID_10" => 10.1);
And then do something like:
Code:
mysql_query("UPDATE $table SET THEVALUE = ".$arrval['ID_0']);
But then all values in the THEVALUE column would be set to $arrval['ID_0'] (.01 in this case) which probably isn't what you want, so you'd need a WHERE clause.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote