Jump to content

Duplicate Results


GreenMamba

Recommended Posts

Hi Guys

 

I'm fairly new to PHP and after some trial and error managed to get the rsults I want from the following script, except that now some of the results are being duplicated.

 

<?php

      $notify_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'");

      while ($notify_products = tep_db_fetch_array($notify_query)) {

      $check_notify = substr($notify_products['products_name'], 0, strpos($notify_products['products_name'], "#"));

 

      $shipment_query = tep_db_query("select products_name, products_date_available from " . TABLE_SHIPMENTS . " order by products_name");

        while ($shipment_products = tep_db_fetch_array($shipment_query)) {

        $check_shipment = substr($shipment_products['products_name'], 0, strpos($shipment_products['products_name'], "#"));

          if ($check_notify == $check_shipment) {

    $list_products = '<tr class="listing_even"><td class="listing_txt">' . $shipment_products['products_name'] . '</td><td class="listing_txt" align="right">Received ' . $shipment_products['products_date_available'] . '</td></tr>';

          }

      }

      echo $list_products;

    }

?>

 

I've tried different variations of array_unique and foreach, but can't get it to work.

 

Any help would be greatly appreciated.

 

Thanks

 

Rudi

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.