Question: I need some help understanding the correct way to mix variables with strings like this. I have tried every configuration I can think of and I keep getting an error.

```
<?php
include('connect.php');
foreach($_GET['item'] as $key=>$value) {
    mysql_query("UPDATE userprojectlist SET category_display_order = '$key' WHERE category_id = '$value' ");
}
?> 

Notice: Undefined index: item in updatedb.php on line 3

Warning: Invalid argument supplied for foreach() in pdatedb.php on line 3

```

Answer: 
Is `item` an array in the url like `item[]`? If it's not that's the reason you get that error, you cannot iterate through a non-iterator object!

Also get rid of the single quotes around the values if they are numeric and use string concatenation,

```
"UPDATE userprojectlist SET category_display_order = " . $key . " WHERE category_id = " . $value . ";"

```
```
mysql_query('UPDATE userprojectlist SET category_display_order = ' . $key . ' WHERE category_id = ' . $value );

```

or

```
mysql_query("UPDATE userprojectlist SET category_display_order = $key WHERE category_id = $value" );

```

This is assuming both variables are integers.