rickytheraccoon
September 27th, 2003, 04:18 PM
Let's say I have a preview page that displays 8 items, each with the product name, price, and a brief description.
Right now I have it coded to where the name and price are entered automatically from a text file, but I realized since these variables are exactly the same as the ones entered into the squirrelcart database, it would be a lot more efficient to call them from that. (I know this is what the squirrelcart does normally anyways but I have basically taken out all of the dynamic category driven navigation and incorporated the needed elements in html).
So my question is what code do I insert into my preview pages to "get" the variables for $name, $price, and $breif_description from the DB. I've been looking through the show_products func and came across:
function get_product($prod_rn) {
$product = get_records("Products","*","record_number = '$prod_rn'");
return $product[0];
}
But I'm not sure exactly what this is returning and how I can echo the variables after it does get them. Any advice would be greatly appreciated.
Mike
Right now I have it coded to where the name and price are entered automatically from a text file, but I realized since these variables are exactly the same as the ones entered into the squirrelcart database, it would be a lot more efficient to call them from that. (I know this is what the squirrelcart does normally anyways but I have basically taken out all of the dynamic category driven navigation and incorporated the needed elements in html).
So my question is what code do I insert into my preview pages to "get" the variables for $name, $price, and $breif_description from the DB. I've been looking through the show_products func and came across:
function get_product($prod_rn) {
$product = get_records("Products","*","record_number = '$prod_rn'");
return $product[0];
}
But I'm not sure exactly what this is returning and how I can echo the variables after it does get them. Any advice would be greatly appreciated.
Mike