473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Query processing

119 100+
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>
Nov 19 '08 #1
1 1820
r035198x
13,262 8TB
Are you talking about JOINing description table with category table?
What are your table structures?
Nov 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: John Peter | last post by:
How can i set the Query Processing Time in my asp page. i am getting this error messages "Estimated query processing time 152 exceeds limit 30" John
0
by: Matt Weakly | last post by:
Greetings: My MySQL (4.1.0 alpha) server crashes while processing large queries from a web page (using ColdFusion 5.0): ODBC Error Code = S1000 (General error) Lost connection to MySQL server...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
4
by: Mark D Powell | last post by:
SQL Server 2000 SP3A Last week one of our processes starting issuing or suffering deadlock detected errors every 15 minutes or so. I have read several articles at MS on the subject. I set a...
7
by: SHPsalm139 | last post by:
I'm working on a school application. I have a form where the user selects the marking period (1, 2, 3 or 4). That ties in to the "marking_period" field in a table. If the user indicates, for...
10
by: varlagas | last post by:
I execute a query (against DB2 for iSeries), which, in its generic form is as follows. This query runs just fine, executing in a couple of seconds SELECT V.FIELD01, V.FIELD02, V.FIELD03,...
1
by: linwu02 | last post by:
Hi, I was wondering if there is a way to intercept the SQL query before it gets send to DB2 query processing. The problem I am facing is that I want to add context information into the query....
15
by: martin DH | last post by:
Good morning, I have added several posts out here on a project on which I am working - thank you very much to everyone who has responded with ideas and solutions! My new question: I am drawing...
4
by: dsdevonsomer | last post by:
Hello friends, I have one simple question. I have two tables. 1 ( Table A ) has about 2.5 million rows and second one ( Table B ) has about 1 million. There are common ID fields in both tables. I...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.