Below is the code I have so far all is working except around line 6 I need help.
Can someone show me how to add an if statement here, if a result exist i would like to run the code below these lines
//Select current top user
$result = mysql_query("select * from friend_vote order by total_value DESC limit 1");
$row = mysql_fetch_array($result);
$winner = $row['id'];
//Check if user is Feature
$result = mysql_query(select auto_id FROM friend_reg_user WHERE auto_id=$winner AND featured='yes');
$row = mysql_fetch_array($result);
IF THIS RESULT EXIST THEN STOP
otherwise run sql below
// If they are not featured, make them feature
$length = 7;
$sql="update friend_reg_user set featured='yes' where auto_id=$winner";
executeUpdate($sql);
$sql2="INSERT INTO friend_featuredusers (user_id, featured, startdate, enddate) VALUES ($winner, '1', NOW(), DATE_ADD(NOW(), INTERVAL $length DAY))";
executeUpdate($sql2);