-2

我需要有关 sql 语句的帮助。我有一个基于“喜欢”的精选用户系统,但是一旦用户被“精选”,他们将无法在接下来的 30 天内成为精选用户。这已经完全用 php/mysql 编写了。有任何想法吗?

4

1 回答 1

1

php端的伪代码:

     $new_date = new DateTime;         
     $new_date->modify('30 day'); //set the next time they can be featured to 30 days in the future   

     while ($row = $qryResult ->fetch_assoc()) { //query table containing user, featured yes/no, date, etc
        $featured_date = new DateTime($row['featuredDate']);

     if ($featured date < $new_date) {
         echo $row['user'];
    }
  }     
于 2013-02-21T20:35:07.890 回答