Reply to Re: Looping through 2 query results

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация