2012-01-07 81 views
0

固定!遺憾浪費任何人的時間:PMYSQL加入兩列並獲取數據

我嘗試獲得兩個colums在PHP中加入了一個與MySQL

$result = $link->query('SELECT Software.*, 
Genre.Naam AS Genre, 
Console.Naam AS ConsoleNaam, 
Draager.Naam AS MediumNaam, 
Studio.Naam AS StudioNaam, 
Publisher.Naam AS PublisherNaam 
FROM Software 
INNER JOIN Genre ON Genre.Genre_ID = Software.Genre_ID 
INNER JOIN Console ON Console.Console_ID = Software.Console_ID 
INNER JOIN Draager ON Draager.Draager_ID = Software.Medium_ID 
INNER JOIN Company AS Studio ON Software.Studio_ID = Studio.Company_ID 
INNER JOIN Company AS Publisher ON Software.Publisher_ID = Publisher.Company_ID 
'); 

表公司已與表格軟件的加入在那裏的ID來獲得的 名公司。

任何提示,我必須改變到上面的腳本,讓它到 工作?

+0

牽着(加入)的拼寫:

JION拼寫與表時,JOIN ... – xQbert 2012-01-07 14:47:07

+0

你能發表你的表格嗎? – 2012-01-07 14:48:29

+0

大聲笑!浪費了3個小時,因爲我沒有選擇。 THANX! – SjoerdvGestel 2012-01-07 14:49:00

回答

1

只是爲了有一個答案:在你過去兩年內招商加盟d

$result = $link->query('SELECT Software.*, 
Genre.Naam AS Genre, 
Console.Naam AS ConsoleNaam, 
Draager.Naam AS MediumNaam, 
Studio.Naam AS StudioNaam, 
Publisher.Naam AS PublisherNaam 
FROM Software 
INNER JOIN Genre ON Genre.Genre_ID = Software.Genre_ID 
INNER JOIN Console ON Console.Console_ID = Software.Console_ID 
INNER JOIN Draager ON Draager.Draager_ID = Software.Medium_ID 
INNER JOIN Company AS Studio ON Software.Studio_ID = Studio.Company_ID 
INNER JOIN Company AS Publisher ON Software.Publisher_ID = Publisher.Company_ID 
'); 
1

您有一個錯字。 JOIN拼錯爲JION

$result = $link->query('SELECT Software.*, 
Genre.Naam AS Genre, 
Console.Naam AS ConsoleNaam, 
Draager.Naam AS MediumNaam, 
Studio.Naam AS StudioNaam, 
Publisher.Naam AS PublisherNaam 
FROM Software 
INNER JOIN Genre ON Genre.Genre_ID = Software.Genre_ID 
INNER JOIN Console ON Console.Console_ID = Software.Console_ID 
INNER JOIN Draager ON Draager.Draager_ID = Software.Medium_ID 
/* Misspelled JOIN below *(/ 
INNER JOIN Company AS Studio ON Software.Studio_ID = Studio.Company_ID 
INNER JOIN Company AS Publisher ON Software.Publisher_ID = Publisher.Company_ID 
'); 
+0

Thnx我忽略了這一點。工作在固定3小時,這就是它:P – SjoerdvGestel 2012-01-07 14:50:21