Jump to content

[SOLVED] LEFT JOIN questions


josephman1988

Recommended Posts

Hi guys,

 

I'm only just getting familiar with joing tables.

I have the following 2 table structures.

 

games:

g_id (Primary Key + Auto Increment)
g_title
g_content
g_release
g_image

 

news:

n_id (Pimary Key + Auto Increment)
n_content
n_date
n_image
g_id

 

So I have the following query to match the 2 id's, but How would I grab the associated g_title.

 

This is my attempt:

SELECT games.g_title, news.n_title, news.n_image, news.n_date, news.n_content, news.g_id
		FROM games
		LEFT JOIN news
		ON games.g_id = news.g_id
		ORDER BY n_id DESC

 

Hope you can help and explain =]

Link to comment
https://forums.phpfreaks.com/topic/122860-solved-left-join-questions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.