ok, we're getting somewhere. Here is a function that should return products but isnt. How can I test where it is going wrong?
For example, if this line is causing an exit, how do I check this:
if (!is_array($this->contents)) return false;
How can I check if the db is not returning data? phpMyAdmin seems to work ok to the db and returns data.
Any other tips appreciated.
function get_checklist($kID) {
global $languages_id;
if (!is_array($this->contents)) return false;
$products_array = array();
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
//$products_query = tep_db_query("select kp.products_id, kp.products_name, kp.products_model, kp.products_price, kp.final_price, kp.products_quantity, p.products_tax_class_id from " .TABLE_KITS_PRODUCTS . " kp, " . TABLE_PRODUCTS . " p where kp.kits_id='" . $kID . "' and kp.products_id = p.products_id");
$products_query = tep_db_query("select products_id, products_name, products_model, products_price, final_price, products_quantity from " .TABLE_KITS_PRODUCTS . " where kits_id='7'"); // and kp.products_id='" . tep_get_prid($products_id) . "'
if ($products = tep_db_fetch_array($products_query)) {
$prid = $products['products_id'];
$products_array[] = array('id' => $products_id,
'name' => $products['products_name'],
'model' => $products['products_model'],
'price' => $products['products_price'],
'quantity' => $products['products_quantity'],
'final_price' => $products['final_price'],
'tax_class_id' => $products['products_tax_class_id']);
}
}
return $products_array;
}