Current location: Hot Scripts Forums » Programming Languages » PHP » Associating MySQL Entries from Different Tables


Associating MySQL Entries from Different Tables

Reply
  #1 (permalink)  
Old 04-20-04, 05:36 AM
aosman1 aosman1 is offline
New Member
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Associating MySQL Entries from Different Tables

Hey,

I am trying to get a MySQL entry to be associated (pulled out and displayed) with another entry in another table. How can I make PHP do that?

If this is possible, can I associate many entries from a table to other another entry in a different table?

Thanks

a.osman
Reply With Quote
  #2 (permalink)  
Old 04-20-04, 07:43 AM
Bonzo's Avatar
Bonzo Bonzo is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
You can do this although I have never tried.

I would guess that if you do two mysql querys; one for each table you would get the info.

To make it easyer for yourself I would have two columns with the same data in in each table to give yourself a referance ! and dont have the same column names in both tables.

e.g. SELECT * FROM table_1 WHERE name = 'dave' ;
SELECT * FROM table_2 WHERE forname = 'dave' ;

Anthony
Reply With Quote
  #3 (permalink)  
Old 04-20-04, 07:51 AM
the_mole001's Avatar
the_mole001 the_mole001 is offline
Newbie Coder
 
Join Date: Feb 2004
Location: Australia
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Hey,

If you truly want to understand the beauty of joining point your browser to:

http://www.devshed.com/c/a/MySQL/Und...ing-SQL-Joins/

and read up on all the exciting ways of joining mysql tables to get your desired result lol

Peter
__________________
Current Project: GGAC Website
Project Link: http://peter.5gigs.com/
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
need help creating tables in mysql (VERY SIMPLE QUESTION) meaculpa1113 PHP 2 03-26-04 12:32 AM
cant create tables in mysql banli PHP 3 02-26-04 06:14 PM
how to show mysql tables..... Merovingian PHP 2 02-04-04 05:06 PM
Deleting older mysql entries mdhall Script Requests 0 11-02-03 01:17 PM


All times are GMT -5. The time now is 10:27 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.