通过php从Mysql数据库中选择数据并随机显示其中一些

I use this code to select some specific data from my database:

 $result7 = mysql_query("SELECT `title`, `image`, `price`, `status` FROM `books` WHERE  `specialoffer` = 1 ") or die(mysql_error());

Then I have 7 rows of my database selected. Now I need to show 3 of them randomly in my home page. How can I handle this with php?

Now I'm using this code showing all of them:

 $row_cnt7 = mysql_num_rows($result7);

    if ($row_cnt7 > 0){
      echo '<table class="sp"><tr>';
      while($row = mysql_fetch_array($result7)) {
      echo'<td><img src="back/'.$row["image"].'" style="border: 3px solid #3498db; height: 175px;"/>
      <br>'.$row["title"].'
      <br>'.$row["price"].'
      </td>';
      }
      echo'</tr></table>';
    }else{
      echo 'No Special Offer Found!';
    }

Alternatively you could let the db do the processing of records by using a query like:-

select 
    `title`, `image`, 
    `price`, `status` 
    from `books` 
    where `specialoffer` = 1 order by rand() limit 3