I'm new to PHP and as I'm getting into arrays its throwing me for a loop. No pun intended. Everything below is giving me what I need so far. $datum contains an array of submission ID's I need. What I'd like to do next is query a table to match all of my submission ID's in $datum to an Image ID column and put that result into an array containing all of the image ID's. Then I need to query the image table to get the file name for each of the Image ID's and put it into a SELECT box. Im just not sure how to work the loops with the arrays. I just can't make FOR EACH and WHILE do what I need. Ive put what Id like to do in plain english below the code. Thanks for any help.
<?php
$mask5 = $_GET["var1"];
require("codebase/grid_connector.php");
$res = mysql_connect("", "", "");
mysql_select_db("supplydb");
//Get Category ID
$cat = mysql_query("SELECT category FROM submissions WHERE submissions.submission_id='$mask5'");
$rows = mysql_fetch_array($cat, MYSQL_ASSOC);
$array = $rows['category'];
//Get Manufactuer ID
$man = mysql_query("SELECT manufacturer_id FROM submissions WHERE submissions.submission_id='$mask5'");
$arows = mysql_fetch_array($man, MYSQL_ASSOC);
$array1 = $arows['manufacturer_id'];
//Get All Submission ID's for this popup
$datum = array();
$result = mysql_query("SELECT submission_id FROM submissions WHERE submissions.category='$array' AND submissions.manufacturer_id='$array1'");
while ($rowd = mysql_fetch_array($result, MYSQL_ASSOC)) {
$datum[] = $rowd;
}
////// WHAT ID LIKE TO DO.......
mysql_query("SELECT image_id FROM imagsub WHERE image_id = $datum[]...
$answers = new array from above result
THEN
mysql_query("SELECT filename FROM images WHERE image_id = $answers[]
THEN
Put into a select box.
Some of this I can struggle with and try to figure out but right now I can't seem to get an array of values from one column in a table based on another array. Any help with the rest is just gravy. Thanks in advance.