0

Iam Using This Code

$result = mysql_query("SELECT games.*,
console.name AS gconsole , 
genre.name AS ggenre ,
company.name as gcompany,
status.name as gstatus 
from games as games
left join console  on  (games.console = console.id)
left join genre  on (games.genre = genre.id)
left join company  on (games.company = company.id) 
left join status  on  (games.status = status.id)");

I Need To Add To It

where id='$id'

Where To Add This ?

2
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by -==Zero==-
0
$result = mysql_query("SELECT games.*,
console.name AS gconsole , 
genre.name AS ggenre ,
company.name as gcompany,
status.name as gstatus 
from games as games
left join console  on  (games.console = console.id)
left join genre  on (games.genre = genre.id)
left join company  on (games.company = company.id) 
left join status  on  (games.status = status.id)");

last line before ");

left join status  on  (games.status = status.id) where id='$id' ");
0
$result = mysql_query("SELECT games.*,
console.name AS gconsole , 
genre.name AS ggenre ,
company.name as gcompany,
status.name as gstatus 
from games as games
left join console  on  (games.console = console.id)
left join genre  on (games.genre = genre.id)
left join company  on (games.company = company.id) 
left join status  on  (games.status = status.id)");

last line before ");

left join status  on  (games.status = status.id) where id='$id' ");

I Got This Error

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\G\GameDetails.php on line 45

And The Line 45 Contain

while($row = mysql_fetch_array($result))
0

You are in a left join statement I don't think this is a WHERE statement problem.

Then Why This Error Show ?

0

The Solution Is

$result = mysql_query("SELECT games.*,
    console.name AS gconsole ,
    genre.name AS ggenre ,
    company.name as gcompany,
    status.name as gstatus
    from games as games
    left join console on (games.console = console.id)
    left join genre on (games.genre = genre.id)
    left join company on (games.company = company.id)
    left join status on (games.status = status.id)WHERE games.id='$id'");
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.