Hello,
I'm new to PHPBuilder. In the past I have found many good threads by searching google.🙂
Now I have run into a really strange problem that I can't seem to find anything about...
I hope someone here will be able to give me a hand.
Here's the problem:
I have a products price query that seems to bring the proper product prices. However if the price is saved in the data base as $188.00 the query and php returns 100.00. If I have a product with the price of $208.00 I'nm getting a return of $200.00.
If I change the prices in the database and echange all the 8 digits such as $199.00 the price is dissplayed properly.
Why is this occuring???
I've read something about octal integrers but what does not make sense to me is that the digit nine (9) seems to work...while valid octal intergrers run from 1-7.
Have I missed something else? This is my PHP query:
$family_sql = "select p.products_id, p.products_model, p.products_image, p.products_tax_class_id, pd.products_name, s.specials_new_products_price, s.status, p.products_price, p.products_family from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id !=" . (int)$HTTP_GET_VARS['products_id'] . " and p.products_id = pd.products_id and p.products_family = '" . $thisquery['products_family'] . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";
$listing = tep_db_query($family_sql);
//*separate prices
$customer_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$customer_group = tep_db_fetch_array($customer_group_query);
$customer_group_name = $customer_group['customers_group_name'];
$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $listing['products_id'] . "' and customers_group_id = '" . $customer_group['customers_group_id'] . "'");
if ( $customer_group['customers_group_id'] != 0) {
if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
$products_price_orig = $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']));
$products_price_discount = $currencies->display_price($customer_group_price['customers_group_price'], tep_get_tax_rate($listing['products_tax_class_id']));
$products_price_saving = $currencies->display_price($listing['products_price'] - $customer_group_price['customers_group_price'], tep_get_tax_rate($listing['products_tax_class_id']));
} else {
$products_price_orig = $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']));
}
} else {
$products_price_orig = $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']));
}
//EOF separate prices*/
and this is how I dissplay the information:
$lc_text = ' <s>' . $products_price_orig . '</s> <span class="productSpecialPrice">' . $customer_group_name . '-team:'. $products_price_discount . '</span> ';
How in the world can I solve this issue?
Thank you in advance.