I would like to know if theres atleast one record in a table for a specified id. I dont need to know how many are there.
Code: Select all
1. SELECT COUNT(`ID`) FROM `table` WHERE `KeywordID` = 15;
2. SELECT COUNT(*) FROM `table` WHERE `KeywordID` = 15;
3. SELECT `ID` FROM `table` WHERE `KeywordID` = 15;
4. SELECT `ID` FROM `table` WHERE `KeywordID` = 15 LIMIT 0, 1;
5. SELECT * FROM `table` WHERE `KeywordID` = 15;
6. SELECT * FROM `table` WHERE `KeywordID` = 15 LIMIT 0, 1;Code: Select all
$row = mysql_fetch_row($res);
if ($row[0] > 1)
{ ... }Code: Select all
if (mysql_num_rows($res) > 1)
{ ... }Thanks