for pagination i need to display number of is my query but am getting error like

 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'st.state)as num from spa s left join relatedcatagories rc on le' at line 1

select count(DISTINCT s.Companyname,,ck.MainCatagory,,st.state,cp.state_id) from spa s 
left join relatedcatagories rc on
left join catagorykeywords ck on
left join subcatagorykeywords sub on
left join city_place cp on
left join states st on st.state_id=cp.state_id
left join cities c on c.city_id=cp.city_id 
WHERE s.Companyname='tester' || st.state='karnataka'

Recommended Answers

All 2 Replies

Hard to say without your table structures. Looks fine at first glance.

I think the issue is the || try this:

WHERE s.Companyname='tester' and st.state='karnataka'
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.