Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Php/mysql Query Of Product Price


osHacker

Recommended Posts

I think this is rather simple, but I can't figure it out, I have an html table on my product_info page that I want to show the price of one product, no matter what product the customer is looking at. But I don't want the actual price to be html, I'd like it to query for the current price from the database, since it will change freqently.

 

Can anyone help me with the php/mysql code?

 

the query I want is

 

SELECT products_price FROM products WHERE products_id = 123

 

but I'm not even sure the query is right, and I can't place it into a php code and get it to work.

 

Any help?

 

Thanks,

osHacker

Link to comment
Share on other sites

you need to use the osc wrapper functions for the sql

 

$check_query = tep_db_query(SELECT products_price FROM " . TABLE_PRODUCTS . " WHERE products_id = '123');
if($check_array = tep_db_fetch_array($check_query) ) {
echo $check_array['products_price'];
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...