Skip to content
Advertisement

show only limited categories with a MySQL queries

I have a mysql database in which there is about hundreds of category for photo album. When i display the album using

JavaScript

so it will display the last 10 categories but if i want to display only 15 categories in between from that hundreds of category what the query should be? i have try this.

JavaScript

here its displaying that category which i want to display but it displaying that inactivate category also which i do not show here by using status=’1′ (inactive status=0) can any body help me with this

Advertisement

Answer

You have to put the WHERE keyword before your conditions.

Also, instead of all of those ORs or ||s, use IN.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement