Jump to content

Checking two tables


boneXXX

Recommended Posts

Hi , I need a help to check 2 tables if the common column is same then I want to get the data. Such as;

 

I have a Participant table: Number, Firstname, Surname

and there is a Result table: Number, Min, Sec

 

I want to get values Min and Sec if Numbers are equal in both table.

 

$result = mysql_query("select Number,Number from Participant2,Result2 WHERE Participant2.Number =Result2.Number");

I get error with these query.

Link to comment
https://forums.phpfreaks.com/topic/73050-checking-two-tables/
Share on other sites

n~ link=topic=163309.msg716017#msg716017 date=1192293624]

select p.Number, r.Number from participant2 p inner join Result2 r WHERE p.Number = r.Number; 

 

~n[EO]n~,  can you explain this please.. I often run into trouble when relating two tables together and returning data..

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/73050-checking-two-tables/#findComment-369419
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.