
January 21st, 2005, 08:47 AM
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 18
Time spent in forums: 42 m 10 sec
Reputation Power: 0
|
|
|
passing array values into mysql - Help please :)
How can I take these array values, which were submit via a form
Array ( [0] => Done [1] => 1 [2] => Northeast Ridge [3] => 2 [4] => Done [5] => 1 [6] => Kahiltna Spire [7] => 4 )
and have then put into variables that can update multiple rows in MySQL?
Here my code snipe from update page:
$com = array("$_POST[completed]", "$_POST[route_name]", "$_POST[id]", "$_POST[user_id]");
foreach ($com as $key => $values) {
include "include/db.php";
$query = "UPDATE ticklist SET completed = '$completed' WHERE route_name = '$route_name' AND id = '$id' AND user_id = '$user_id'";
$result = mysql_query($query,$db) or die(mysql_error($msg));
Basically I am trying update 2 rows in MySQL.
Last edited by m0untaind0g : January 21st, 2005 at 09:30 PM.
Reason: no reason...
|