Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 08-25-2007, 12:22 AM
MephDaddy MephDaddy is offline
Junior Member
 
Join Date: 08-25-07
Posts: 2
iTrader: 0 / 0%
(PHP/Mysql) Question reguarding tables and sharing data between.

Ok here is my problem:

I have 2 tables, instance and boss

boss table has 3 varables [id, name, instid]
instance table has 2 variables [id, name]

in boss.instid is my way of pointing to instance.id

When displaying my information for the boss table I would like to show id, name, and instid.

But instead of just having a number that represents my instid i want it to take the name from instance table that is associated with that id.

I have searched thru endless tutorials on how to try and do this and have yet to find something that gives me a hint about how to do it. I might even be going about this the entirly wrong way.

I would appreciate any advise people can give me on this. I do I hope i made my idea clear.
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 08-25-2007, 10:57 AM
Taltos's Avatar
Taltos Taltos is offline
v7n Mentor
 
Join Date: 11-22-06
Location: Phoenix, AZ
Posts: 1,797
iTrader: 0 / 0%
you need to do a sql query that looks something like this:
Code:
select boss.id, boss.name, instance.name from boss join instance on boss.instid = instance.id
That should return what you are looking for and you can use php/mysql commands to read the data and do whatever you need to with it.

Good Luck
 
Reply With Quote
  #3  
Old 08-25-2007, 11:47 AM
MephDaddy MephDaddy is offline
Junior Member
 
Join Date: 08-25-07
Posts: 2
iTrader: 0 / 0%
I will give that a try thank you.
 
Reply With Quote
  #4  
Old 08-25-2007, 01:09 PM
T0d's Avatar
T0d T0d is offline
v7n Mentor
 
Join Date: 01-11-04
Location: Sacramento
Posts: 1,569
iTrader: 0 / 0%
If you index the join column it will go faster
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
stupid LOCK TABLES message with MySQL - please help! CircleOfLinks Web Design Lobby 5 01-01-2008 04:21 AM
Returning MySQL Results as HTML Tables... Or something like that. Mega Mario Coding Forum 9 12-22-2007 07:20 AM
question about linking tables I like pie Coding Forum 6 03-28-2006 08:14 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:26 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC