Jump to content

Array's


bradynorman

Recommended Posts

Hi,

 

I am using the following code;

 

 

mysql_select_db($database_grcdb, $grcdb);

foreach($id as $val) {

  $val2=$_POST['bin'];

  $query = "UPDATE stock SET status = 'warehouse' SET bin = '$val2'  WHERE id = '$val'";

  mysql_query($query) or die(mysql_error());

}

mysql_close();

$updateGoTo = "stock.php";

header(sprintf("Location: %s", $updateGoTo));

 

 

the error i get is ;

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET bin = 'Array' WHERE id = '6'' at line 1

 

the form is submitted with to variables id[] and bin[]

 

What am i doing wrong so that the $bin is not updated each time the loop runs?

 

cheers

Mike

 

Link to comment
https://forums.phpfreaks.com/topic/119322-arrays/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.