Posted by Kenoli on 02/08/07 17:26
On Feb 8, 2:00 am, "Captain Paralytic" <paul_laut...@yahoo.com> wrote:
>
> If the results are linked by a common column then query using a JOIN
> between the tables thus:
>
> SELECT *
> FROM table1
> JOIN table2 USING(person_id)
> WHERE .....
>
> Then all your results are in single rows based on person_id
This sounds exactly what I would like to do but haven't been able to
get to work. Here is the query based on your format applied to my
tables with the php code:
$query = "SELECT * FROM tbl_person JOIN tbl_contact_info USING
(person_id) WHERE person_id = '5' OR person_id = '6';";
$result = mysql_query ($query);
if (!$result) {echo "<br/><br/>You screwed up!";} else {echo "<br/><br/
>You succeeded!<br/><br/>";}
The result is: "You screwed up!"
What am I not getting????
Thanks,
--Kenoli
Navigation:
[Reply to this message]
|