@ecartz
Hi, I am trying to change the script above to check for missing product descriptions. I have it working but it only shows products with descriptions urgh
Code: Select all
/* Our products_description array is now built, start checking data. */
$missing_description = [];
foreach ($db->fetch_all("SELECT products_id, products_description FROM products_description") as $product) {
if ($product['products_description']) {
Guarantor::guarantee_subarray($missing_description, $product['products_id']);
$missing_description[$product['products_id']][] = $product['products_description'];
}
}
Code: Select all
<?php
foreach ($missing_description as $id => $data) {
$product_query = $db->query("SELECT p.products_id, pd.products_name, pd.products_description FROM products_description pd INNER JOIN products p ON p.products_id = pd.products_id ORDER BY p.products_id");
$product = $product_query->fetch_assoc();
?>
<tr>
<td><?php echo $id; ?></td>
<td><?php echo Product::fetch_name($id); ?></a></td>
<td>
<?php
if (count($missing_description) > 0) {
if (is_array($data) || is_object($data))
{
foreach ($data as $d) {
echo $d . '<br />';
}
}
?>
</td>
</tr>
<?php } } ?>
I have tried changing line
to
Also tried '', FALSE and array() but not working
I have changed line
Code: Select all
if (count($missing_description) > 0) {
to
Code: Select all
if (empty($missing_description)) {
but still reporting products with description