Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sort order for tep_db_fetch_array


veral

Recommended Posts

Posted

Hi,

 

Taking the following query and entering it directly into the DB works fine, however tep_db_fetch_array appears not to register the sort for some reason - it returns results which are always sorted (in the display) by products_id. Can anyone provide a helpful solution?

 

 

 ? ? ? $sql2 = tep_db_query("SELECT p.products_id, p.products_model, p.products_quantity, p.products_status, p.products_image, pd.products_name from products p, products_to_categories ptc, products_description pd where p.products_id = ptc.products_id and p.products_id = pd.products_id and ptc.categories_id = '" . $HTTP_POST_VARS['cat_id'] . " order by pd.products_name'");


? ? while ($results = tep_db_fetch_array($sql2)) {
? ? ? ? ? ? ? ?echo $results['products_id'] . $results['products_name'] . '<br>';

}

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...