thats for all the help HalfaBee & bradgrafelman i am trying your new code just now but all im getting is array its looping the correct number of times but its not pulling the information from the array.
also how do i go about if i want to display other fields in the same array.
this is the script i have so far
<?php
// Make a MySQL Connection
include("database.inc");
$part = array('AC0001','AC0002','AC0001','AC0066');
$conn = mysql_connect("$host", "$user", "$passwd");
mysql_select_db("$database", $conn);
$sql = "SELECT * FROM barcode WHERE part IN('".implode("', '", $part)."')";
$result = mysql_query($sql);
while( $bc = mysql_fetch_assoc( $result ) ) {
$barcodes[$bc['part']] = $bc;
}
$part = array('AC0001','AC0002','AC0001','AC0066');
foreach( $part as $bc ) {
?>
<table>
<tr>
<TD><?php echo $barcodes[$bc]; ?></TD>
</tr>
</table>
<?php
}
print_r($barcodes);
echo "";
var_dump($barcodes);
?>
Thanks
Acemods