Jump to content

[SOLVED] MYSQL Multiple Tables > Displaying a row with the same tableid


adultexpertise

Recommended Posts

Hey guys,

 

I've got this problem with a mysql query of mine.

 

$sql = "SELECT p.id, p.uid, u.id, u.country FROM provide_cameraman p, user_data u WHERE p.id = 1 AND u.id = p.uid";

$res = mysql_query($sql);

$row = mysql_fetch_array($res);

 

The user_data and the provide_camerman table both have a row with the label ID.

How can I display $row[id] for the user_data and provide_cameraman table?

When i do this now it only shows the provide_cameraman row.

Displaying the entire array shows that the user_data entry has no ID.

 

I hope you guys can help me :)

 

Thanks so much in advance!

tr this

$sql = "SELECT p.id, p.uid, u.id, u.country, u.id as uID, p.id as pID
FROM provide_cameraman p, user_data u 
WHERE p.id = 1 AND u.id = p.uid";

 

$row[uID] = user_data id

$row[pID] = provide_cameraman id

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.