Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
how do i access this setup of tables?
Old 02-09-2009, 07:53 AM how do i access this setup of tables?
Banned

Posts: 34
Trades: 0
helo .....again... quick note, u guys are saints, i learn so much here.
i have a question , lets say i have 2 tables
tbl1 :
id
businessid
product
price

tbl2
busiid
bussinesstitle
email

i wana query all the info, do i use a join or do a double query? i am also abit abit clueless what to do i normalize the tables more, so lets say i add a third table holding just tbl1.id and tblbusiid, do the same search rules apply??
Necaxa is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-09-2009, 08:53 AM Re: how do i access this setup of tables?
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
I'm not sure what you want exactly.
Do you want to select something from tbl1 first and depending on that businessid, select something from tbl2?

If so, you need something like this:
Code:
SELECT * FROM `tbl1`,`tbl2` WHERE `tbl1`.id='SOMETHING', `tbl2`.busiid=`tbl1`.businessid
Not sure, for it has been a while since I last used this.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 02-09-2009, 10:29 AM Re: how do i access this setup of tables?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
Not sure, for it has been a while since I last used this.
It's right, and for the record, it's a jointed query between the 2 tables.

Quote:
do i use a join or do a double query?
There is no absolute truth.
Sometime, a big query will work faster if you break it in several smaller parts.
Sometimes, it's better to use a whole lot of joints.
In the end, your db schema will be a big part of the choice of 1 road or the other.

It's what one of my colleagues refer as "galactic joins" .
Ie: you have more then 30 tables joined, and you don't understand where you came from nor where you are headed, and not really sure of what you want to do anymore.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-09-2009, 01:23 PM Re: how do i access this setup of tables?
Banned

Posts: 34
Trades: 0
thanks, yeah that answers my question, i just thought there was a specific way to search when searching large tables.

thanks alot
Necaxa is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how do i access this setup of tables?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37863 seconds with 12 queries