if didalam where

http://stackoverflow.com/questions/5987208/if-statement-inside-where-clause-in-sql
http://stackoverflow.com/questions/15162404/if-else-on-where-clause
http://www.electrictoolbox.com/mysql-using-if-in-where/

$query="SELECT * FROM (SELECT * FROM $bc_tb_mhs WHERE (status_mahasiswa='sore' OR status_mahasiswa='karyawan')  AND
(IF( '$pilih' = 1 ,fakultas !='' , fakultas = '$pilih' ))  AND  semester_aktif ='$semseter'
AND user_ud !='') a LEFT JOIN $bc_tb_prodikum b ON a.program_studi=b.id_prodi";



SELECT *
FROM events
WHERE IF(startTime IS NULL, '$date', '$unix') =< startDate

Subscribe to receive free email updates:

0 Response to "if didalam where"

Post a Comment