hi all. i from turkey. my english is very bad. too sorry all. i have a this problem; i have 2 table. first and second. i want to secont just one listing. $rilana = mysql_query("SELECT * FROM ilanlar INNER JOIN resimler ON ilanlar.id=resimler.emlak WHERE durumu=1 and yayin=1 or yayin=5 and NOW()<=bittarih order by RAND()"); turkish resim english photos. emlak is english estate. every estate have lot of photos. but i want listing every estate with just one photo.
Your English isn't that bad. ilanlar.id=resimler.emlak ilanlar.id has to be the same data type (integer, char, etc.) as resimler.emlak. bittarih has to be a date in the proper format (see the manual). Date with no time is the beginning of the day - 00:00:00. Did you mean WHERE (durumu=1 and (yayin=1 or yayin=5) and NOW()<=bittarih) or WHERE (durumu=1 and yayin=1) or (yayin=5 and NOW()<=bittarih) or WHERE (((durumu=1 and yayin=1) or yayin=5) and NOW()<=bittarih) you have to be specific with these fields to be sure that you get what you want.
this one WHERE (durumu=1 and (yayin=1 or yayin=5) and NOW()<=bittarih) and i want added to the (join table) table limit 1
$rilana = mysql_query("SELECT * FROM ilanlar INNER JOIN resimler ON ilanlar.id=resimler.emlak WHERE (durumu=1 and (yayin=1 or yayin=5) and NOW()<=bittarih) order by RAND()"); Not that complicated.