RE: Inner Join or 2nd Query...?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

with wanting to show both product types(Switch, Router etc) and 
Makers(Cisco, Avaya, etc) on the one page in select boxes, I was 
wondering, do you use 2 seperate queries to the database or do you inner

join to get all in 1..? I have set up different tables with related id's

etc. So, to get Products.product_name and Products.product_id along with

what the below query pulls, what wold be best..? I believe if I do a 2nd

query, than some variables need to be identified with the particular 
query, yes..? Cheers.
----------------------------------------
What is your question in one sentence?

Is it "how do I do an inner join"?
Is it "are two separate queries on two tables faster than one query on
both tables"?
Or something else entirely?

----------------------------------------
<html>
<body>
<hr>
<h1 align=center>JUMBO STATUS</h1><p>
<center>Used Hardware Specialist</center>
<hr>
<h2 align=center>Admin</h2>
<table align="center" border="2">
<tr>
<td><h3 align=center>PRODUCT TYPE</h3></td>
</tr>
<tr><td><center>
<select name="poduct_type">
<?php
$db = mysql_connect("localhost", "root", "grunger");
mysql_select_db("status",$db); $result = mysql_query("SELECT
ProductTypes.product_type_detail, 
ProductTypes.product_type_id FROM ProductTypes",$db);
$num = mysql_num_rows($result);
for ($i=0; $i<$num; $i++){
$myrow=mysql_fetch_array($result);
$product_type=mysql_result($result,$i,"product_type_detail");
$product_type_id=mysql_result($result,$i,"product_type_id");
echo "<option value=\"$product_type_id\">$product_type</option><br>";
}
?>
</select>
</center>
</td></tr>
</table>
<p>
<p>
<p>
<hr><center>email: status1@xxxxxxxxxxxxx<p>
Telephone: 03-5209-1777<p>
Fax: 03-5209-2539
</center>
<hr>
</body>
</html>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY

**********************************************************************

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from http://www.gammaglobal.com

E&OE

**********************************************************************
**********************************************************************


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux