|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
MySQL 5 - Can't Figure Join
Hi,
First post here, just learning both PHP and MySQL so please excuse my ignorance. I have 3 tables, one where main data is held and two that hold lists, Categories and Types. I currently have query Code:
SELECT * FROM systems_main_data WHERE bet_cat_id = 1 My issue is on system_main_data table type_id relates to type_id in bet_type table. I can't figure out how to display the type name instead of the ID. Please see tables below Systems_main_data Field Type Null Key Default Extra main_data_id mediumint(8) unsigned NO PRI NULL auto_increment main_data_name varchar(100) NO bet_cat_id varchar(50) NO main_data_description text YES NULL main_data_cost float NO main_data_url varchar(255) NO reg_date datetime NO type_id mediumint(9) NO systems_bet_cat bet_cat_id mediumint(8) unsigned NO PRI NULL auto_increment bet_cat_name varchar(50) NO UNI bet_type type_id mediumint(8) unsigned NO PRI NULL auto_increment type_name varchar(10) NO |
|
#2
|
|||
|
|||
|
Resolved
With help from my visual quickpro book I figured out myself.
If anyone interested see query below Code:
SELECT * FROM systems_main_data LEFT JOIN bet_type USING (type_id) WHERE bet_cat_id = 1; Quote:
Last edited by delboy2405 : April 13th, 2008 at 06:44 AM. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > MySQL 5 - Can't Figure Join |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|