Thank you FG - this is exactly what I needed.
I think I 've got the query perfect, but how best to display like:
5 jane doe send_rep
4 mignon hunter tic 2-3, send_rep
here's my query:
$query = "SELECT cust.id, first, last, company, choice FROM cust, contact
where cust.id = contact.id";
while ($r
Hi all, new to the list :)
I would try something like this:
Select name, company, choice
>From Table1, Table2
Where Table1.id = Table2.id;
Fg
> Can someone please help me or direct me to some scripts that might get
> me unstuck, as I've not done this kind of query before.
>
> To simplify:
>
Tables are listed below the code
I couldnt get the foreach to work properly that Brent sent..I keep getting:
"Invalid argument supplied for foreach() ".
I've tried lots of different stuff but here's an example:
*
$query = "SELECT * FROM cust"
Well I'm still working on this off and on - still having problemos :|
I couldnt get the foreach to work properly..I keep getting:
"Invalid argument supplied for foreach() ".
I've tried lots of different stuff but here's an example:
*
$query =
The way I handle queries like this is to use an associative array with
the ID as the named index key. You then loop through the data
consolidating the choices and linking the other data based on id. Since
you are using a named index, it doesn't matter how your data is sorted.
//Consolidate your
need
to query. I guess I can get the data I want by selecting all from the 5
tables then parsing"
Send your tables structure.
- Original Message -
From: "Mignon Hunter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 26, 2004 3:07 PM
Subject: Re:
r" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 26, 2004 3:07 PM
Subject: Re: [PHP-DB] Stumped with proper query & display
Can someone please help me or direct me to some scripts that might get me
unstuck, as I've not done this kind of query before.
Can someone please help me or direct me to some scripts that might get me unstuck, as
I've not done this kind of query before.
To simplify:
Table 1
id 1
Name John Doe
company IBM
Table 2
id1
choice choice #1
id