multiple table inner join didn't get expected values Student_register table:

regNo 
pro(HNDIT,HNDA,HNDFT)
name
start_day
etc ... more columns 


Semester:

regNo
curSemmester(3,4,5)
name


The query I used to get values:

SELECT student_register.pro='HNDIT', student_register.regNo,sem.curSem =4,sem.name
FROM student_register
INNER JOIN sem
ON sem.regNo = student_register.regNo
ORDER BY sem.regNo;


I need to get regNo from student_register that according to pro = hndit or any other (hndft/HNDA) then I want to compare those regNo to current semester which that user define curSem=3 (4/5/6) regNo Numbers 

Get student numbers who do HNDIT course and then get regNO from semester table that user define semester(3 or 4 or 5 ) student who do Course hndit:

student_register.pro='HNDIT' -&gt; sem.curSem =4 -&gt; regNo and name
Suppose that you want sem3 then query will be

Case 1# 

Select stureg.regno,stureg.pro,stureg.name,stureg.start_day,
sem.regno,sem.curSemmester,sem.name
from student_register as stureg left outer join semester as sem on stureg.regno=sem.regno
where stureg.pro REGEXP '^H' and sem.CurSemmester='3'

group by regno

order by regno
;


Case 2#

Select stureg.regno,stureg.pro,stureg.name,stureg.start_day,
sem.regno,sem.curSemmester,sem.name
from student_register as stureg left outer join semester as sem on stureg.regno=sem.regno
where stureg.pro like '%H%' and sem.CurSemmester='3'

group by regno

order by regno
;


Give it Try.