我有两个我的Sql表,如:
Cat
------
id : INT NOT NULL PRIMARY KEY
name : VARCHAR(32)
Cheezburger
-------
id : INT NOT NULL PRIMARY KEY
catId : INT FOREIGN KEY REFERENCES Cat (id)
pattyCount : INT
When I perform a LEFT JOIN
on the two tables using PHP s PDO I d do the following:
$database = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $pasword);
$query = $database->prepare(
SELECT * FROM Cat
LEFT JOIN Cheezebuger.id ON Cheezburger.catId = cat.id
WHERE Cat.id = ? );
$query->bindParam(1, $someId);
$query->execute();
$cat = $query-fetch();
我的问题是,我如何区别<代码>id与<代码>有关的领域。 Cat table and the id
associated with the Cheezburger
table? www.un.org/Depts/DGACM/index_french.htm 页: 1