Connecting Tech Pros Worldwide Forums | Help | Site Map

Query processing

Member
 
Join Date: Nov 2008
Location: Chennai, India
Posts: 100
#1: Nov 19 '08
Hai to all,

I have one query to execute two things,

Expand|Select|Wrap|Line Numbers
  1.  echo "<TD class=\"main\"><SELECT NAME=\"current_product_id\">";
  2.  
  3.  $query = "SELECT * FROM ".TABLE_PRODUCTS_DESCRIPTION." where products_id LIKE '%' AND language_id = '" . $_SESSION['languages_id'] . "' ORDER BY products_name ASC";
  4.  
  5.  $result = xtc_db_query($query);
  6.  
  7.  $matches = xtc_db_num_rows($result);
  8.  
  9.  if ($matches) {
  10.  while ($line = xtc_db_fetch_array($result)) {
  11.  $title = $line['products_name'];
  12.  $current_product_id = $line['products_id'];
  13.  
  14.  
  15.  echo "<OPTION VALUE=\"" . $current_product_id . "\">" . $title;
  16.  }
  17.  
What i want to do here is i want to take another table value and i should show that in the above select box.

(i.e) here i used products_description table and displayed $current_product_id = products_id, $title = products_name in option value.

now i want to take the category name from another table for the selected product and i should display with the $title like

<option value = "1234">yellow color($title) - color(category name)</option>

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Nov 19 '08

re: Query processing


Are you talking about JOINing description table with category table?
What are your table structures?
Reply