Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

'Weight' Column Changed to Text


tsvenkat

Recommended Posts

Posted

Hi

 

We have just changed the PRODUCT_WEIGHT field to VARCHAR(64) in the DB

 

Now, we keyed in some text in weight field while adding a new product and it accepted.

 

When we tried to put the WEIGHT Field in the product_info.php, it does not show up.

 

------------------------------------------

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_mp3, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_weight from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

-----------

<td bgcolor="#FF0000"><span class="pageHeading"><?php echo $products_weight; ?></span></td>

----------------

It does NOT show up...

why ?

 

rgds

 

Venk

Posted
Hi

 

We have just changed the PRODUCT_WEIGHT field to VARCHAR(64) in the DB

 

Now, we keyed in some text in weight field while adding a new product and it accepted.

 

When we tried to put the WEIGHT Field in the product_info.php, it does not show up.

 

------------------------------------------

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_mp3, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_weight from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

-----------

<td bgcolor="#FF0000"><span class="pageHeading"><?php echo $products_weight; ?></span></td>

----------------

It does NOT show up...

why ?

 

rgds

 

Venk

 

Because you should use it like this

		<td bgcolor="#FF0000"><span class="pageHeading"><?php echo $product_info['products_weight']; ?></span></td>

Look at the first line right after the query. It says

	$product_info = tep_db_fetch_array($product_info_query);

and fills an array called $product_info with information for all fields you defined with your query.

 

HTH

Archived

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

×
×
  • Create New...