My multidimensional array is :
Array (
[0] => stdClass Object (
[processId] => H5-05848939
[productCode] => ITBYMZ
[availabilityStatus] => InstantConfirmation
[totalPrice] => 27
[packagingType] => Box
)
[1] => stdClass Object (
[processId] => H5-05848939
[productCode] => ITOLDZ
[availabilityStatus] => InstantConfirmation
[totalPrice] => 37
[packagingType] => Box
)
[2] => stdClass Object (
[processId] => H5-05848939
[productCode] => IYDYMZ
[availabilityStatus] => InstantConfirmation
[totalPrice] => 37
[packagingType] => Bulk
)
)
And i have a SQL Database that contains almost all the products images. I need to remove from the above array all the products that does not have an image.
I query the sql db with below code:
for ($n = 0; $n < 60; $n++) {
$productc= $productCodes[$n];
$result = mysql_query("SELECT ImageURL FROM Flat_table where ProductCode= '$productc'", $link);
if (!$result) {
die("Database query failed: " . mysql_error());
}
while ($row = mysql_fetch_array($result)) {
$ImageURL[$n] = $row["ImageURL"];
}
}
Have any ideea how can i do this : I need to remove from the above array all the products that does not have an image.