I have two mysql tables
myTabs
- id
- usercode
- tab_id
- fid
- tablistid
Tabs
- tab_id
- title
- usercode
- access_type
- question
both tables have tab_id as primary key and use the same value. I want to list the data from mytabs table which has same tab_id in Tabs Table and access_type = 1. I dont want to list the records from Tabs the query should only validate from Tabs if that Tab has access_type 1 then it should list
Is it possible? What I am trying is it has not returned anything.
$mysql = "select mytabs.*, tabs.* FROM mytabs, tabs where mytabs.usercode='$usercode' and (mytabs.fid IS NULL || mytabs.fid='0') and tabs.access_type = '1' order by mytabs.tablistid asc"