| 
	
 | 
 Posted by kiqyou_vf on 01/08/06 10:25 
David Haynes wrote: 
> Jerry Stuckle wrote: 
> > kiqyou_vf wrote: 
> >> I'm trying to pull data from 2 different tables and do a loop to 
> >> retrieve more than one row. I'm having problems with aligning the 
> >> information. Can someone lead me in the right direction? I've done some 
> >> looking myself and found something called GROUP BY? Is that what I need 
> >> to use? Thanks in advance. 
> >> 
> > 
> > Sorry, my mind reading isn't working this morning. 
> > 
> > It's impossible to tell without knowing the structure of your tables, 
> > the code you're using and the output you expect. 
> > 
> Sounds more like a UNION problem, but Jerry is right. We need more 
> information to make reasonable comments. 
> 
> -david- 
 
 
I have a page that displays multiple search results. On each search 
result I want unique information from two or more tables to be 
displayed. All tables have a "client_id" column. I need the main query 
to display results based on the $_GET['keywords'] and a second table to 
display results based on the "client_id" of the main query. I don't 
have any code as of yet to show you. I have done some research on UNION 
and found this on mysql.com: 
 
"Selected columns listed in corresponding positions of each SELECT 
statement should have the same type. (For example, the first column 
selected by the first statement should have the same type as the first 
column selected by the other statements.) The column names used in the 
first SELECT statement are used as the column names for the results 
returned." 
 
Is this going to be a problem since the names and information are going 
to be  different on each of my tables.
 
  
Navigation:
[Reply to this message] 
 |