this is my table in phpmyadmin name documents. In html form, dropdown of subject name in not compulsory to select. So it can be blank and get 0 that shown in table. But when I run select query to get all documents list, can't get data of sub_id which value is 0. I want all data from documents table. Plz solve this.
$list=mysqli_query($con,"select documents.*,courses.cour_name,subjects.sub_name from documents join courses on documents.cour_id=courses.cour_id join subjects on documents.sub_id=subjects.sub_id") or die(mysqli_error($con));
doc_id=primary key,
cour_id=index key,
sub_id=index kry
doc_id cour_id sub_id doc_name
1 1 0
6 1 2 MB-C250D-AvantGarde-2012.JPG
7 1 1 adview.sql
8 1 2 crane.txt
9 1 0 ui.txt
result after run select query
Document Id Document Name Course Subject
6 MB-C250D-AvantGarde-2012.JPG B.com Statistics
7 adview.sql B.com Accounting
8 crane.txt B.com Statistics