adultexpertise Posted October 27, 2007 Share Posted October 27, 2007 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! Link to comment https://forums.phpfreaks.com/topic/74985-solved-mysql-multiple-tables-displaying-a-row-with-the-same-tableid/ Share on other sites More sharing options...
MadTechie Posted October 27, 2007 Share Posted October 27, 2007 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 Link to comment https://forums.phpfreaks.com/topic/74985-solved-mysql-multiple-tables-displaying-a-row-with-the-same-tableid/#findComment-379211 Share on other sites More sharing options...
adultexpertise Posted October 27, 2007 Author Share Posted October 27, 2007 Thanks so much! It works Link to comment https://forums.phpfreaks.com/topic/74985-solved-mysql-multiple-tables-displaying-a-row-with-the-same-tableid/#findComment-379216 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.