I want to include some variables in an HTML table. The variables are stored in phpmyadmin and my site a CartWeaver site, I'm using Dreamweaver.

How do I insert variables into separate table cells? I thought this would work but it isn't so:

<?php echo($row_rsCWResults["product_ShortDescription"] . "<br />") ?>
7 Years
Discussion Span
Last Post by CFROG

Much simpler:

What is the code to display the value of the field "product_style" in an HTML table cell?


Your pulling this $row_rsCWResults["product_ShortDescription"] from a separate page in your script.

The best option for what you have going on is to query the db again to pull that value for the page where it's needed.

A generic query would look something like this ... you can fill in the table info as needed.

$query=mysql_query("SELECT col_name FROM table_name WHERE  col_name='$some_value'");

echo "$product"; 
// OR 

my database is qcdb my table is tbl_products and the variable is product_style, how does it go?

what is $some_value?

Edited by IAuchmoody27: n/a


Assuming that you have more than one product style listed in your table, $some_value would be the specific product style you want to display. Let's say you have 3 different product styles (example1, example2, and example3) and you want to display the product style of example2.

$query=mysql_query("SELECT product_style FROM tbl_products WHERE  product_style='example2'");
echo "$product"; // <-- will output 'example2'

You can pull other information as well related to that item. Price, description, etc.
It may be worth for it for you to check out a tutorial that will break it down for you step by step and you can try a few things out for yourself.


I'll be hammering as many tuts as I can over the weekend. I'm not sure we're talking about the same thing though.

I want it to pull the style associated with the current product, not pull the product according to the style I want, though..


That wouldn't be a problem at all, the query just needs to be changed a bit.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.