I have two tables, one of them is projects, and the other is users.
PROJECTS table
ID | USER_ID | NAME
-------------------------------------
80 | 1 | ABC Co.
82 | 2 | XYZ Inc.
USERS table
ID | FIRSTNAME | LASTNAME
-------------------------------------
1 | Joe | Namath
2 | Jimmy | Fallon
I want to write a query, for example:
SELECT * FROM PROJECTS, USERS WHERE PROJECTS.USER_ID=USERS.ID AND FIRSTNAME = "Joe"
I can successfully execute the request in php, but when I try to access the results, I do not get what I want. I understand why, but I cannot figure out how to fix it. For instance:
$row = mysqli_fetch_query($awesomeDatabaseLink);
echo $row['ID]; //returns '1' and I really wanted '80'
I understand. Two tables have fields with the same name, but this is not the same data. MySQL returns its best guess about what I so ambiguously requested. However, I also tried:
echo $row['PROJECTS.ID'];
, "*" . "" ( , ). "" , , .
?
SH