rendered paste body $subSelect = "SELECT image_id,image_tag from imagetags where image_id = '$img_image_id'";
$resultSub = mysql_query($subSelect) or die(mysql_error());
$subArray = array();
$tagValue = '';
while($rowSub = mysql_fetch_assoc($resultSub))
$subArray[] = $rowSub;
}
for( $i= 0; $i< sizeof($subArray); $i++ ) {
foreach ($subArray[$i] as $subValue) {
$tagValue = $tagvalue." ,".$subValue;
}
$imageTags[$subArray[$i]['image_id']][] = $tagValue;
}
//
The above will give you a mutlidemnsional array that looks like, assuming the image_id = 1
$imageTags[1][0] = dog
$imageTags[1][1] = white
$imageTags[1][2] = short hair
etc