Gurus,
I have a merged array like so:
Any help/advice/assistance is very much appreciated. Thank You.
I would like for the dynamic drop down to be as such, using the example above.
Here is my full code:
I have a merged array like so:
Code:
array(796) {
[0]=>
array(2) {
[0]=>
string(32) "(15) Mexican Spaghetti (Tuesday)"
[1]=>
string(5) "22265"
[1]=>
array(2) {
[0]=>
string(13) "A BOWL OF RED"
[1]=>
string(5) "22266"
}
[2]=>
array(2) {
[0]=>
string(21) "A Red Chili Nightmare"
[1]=>
string(5) "22267"
}
[3]=>
array(2) {
[0]=>
string(25) "A TO Z OF SPICES (PART 1)"
[1]=>
string(5) "22268"
}
Any help/advice/assistance is very much appreciated. Thank You.
I would like for the dynamic drop down to be as such, using the example above.
Code:
<option value=22265>Mexican Spaghetti (Tuesday)</option>;
Here is my full code:
Code:
<?php
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "root";
$dbname = "recipes";
mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die(mysql_error());
$cat = $_REQUEST['cat'];
$cat = mysql_real_escape_string($cat);
$name = mysql_real_escape_string($name);
$query = "SELECT auto, name FROM recipes_pro_new WHERE category = '$cat'";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$items[] = array_merge($row['name'],$row['auto']);
}
echo"<pre>";
var_dump($items);
echo "<select name=name size=10 id=name>";
foreach($items as $item)
{
$filter = implode(",", $item);
echo "<option value=>".$filter."</option>";
}
?>