MySQL Forums
Forum List  »  General

Problem with Left joins and WHERE clause
Posted by: Gordon Stewart
Date: February 11, 2019 03:56AM

Code:-

SELECT *
FROM story_category_link
LEFT JOIN main ON story_category_link.indexa=main.Index
WHERE story_category_link.Category='ARRANGEMENT'

Hello. Is there a good (up to date) tutorial on MYSQLI & left joins ?

Basically, my Host uses phpMyAdmin 2.8.0.1 (a web interface for MYSQL).

It has a good SQL command area where I can type commands in directly.

If I put in my Code - SELECT *
FROM story_category_link
LEFT JOIN main ON story_category_link.indexa=main.Index


I basically get ALL the rows available to me. Ive been on google & searching various websites, But if i try to put a WHERE clause in the command, i either get 0 results, or various errors saying ive got a problem with my SQL.

Basically, the table story_category_link with field Category has a list of different categories.

i choose a category, this gives me a reference number (or list of references). (indexa / Index). then it gives me all results from table main that have those reference numbers.


This script worked fine up until a day or so ago, & i noticed my website was giving nil/blank results.

ive identified the problem with this SQL command & have been trying to fix it for the last 5 hours


can anyone assist.

Options: ReplyQuote


Subject
Written By
Posted
Problem with Left joins and WHERE clause
February 11, 2019 03:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.