Jump to content

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.