原生sql語句

1.查

$sql='SELECT integral '.
                'from ' . $this->pre .
                "goods where is_integral = 1 AND goods_id = '$goods_id'";
            $res= $this->query($sql);

2.改

 $sql = "UPDATE " . $this->pre .
            "users SET integral_total=integral_total-('$integral_oneday'),".
            " integral_now = integral_now + ('$integral_oneday')," .
            " integral_already = integral_already + ('$integral_oneday')" .
            " WHERE user_id = '$user_id'";
        return $this->query($sql);
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章