Jump to content

[SOLVED] MYSQL problem


gonny

Recommended Posts

Hi!

$query = $DB->query( "SELECT id, id_cat, title, field1, image FROM articles WHERE id_cat=1 OR id_cat=2 OR id_cat=3 OR id_cat=4 AND field1=1 ORDER BY `id` DESC LIMIT 1");

 

This must show articles from category 1 or 2 or 3 or 4 where field1 is 1 order by id and limit 1.

The problem is to field1 this query show articles where field1 has value 0 (field1=0).

How can solve this or where is the problem in this query?

Link to comment
https://forums.phpfreaks.com/topic/74363-solved-mysql-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.