选择特朗普今日记录.time()

时间:2016-12-09 06:14:03

标签: mysql sql select

这就是我存储它们的方式

INSERT INTO Trump SET code='".$name."', type='cja', whendate='".time()."'

现在我要显示今天的记录。

SELECT * FROM Trump WHERE type='cja' AND DATE(whendate) = time(NOW()) ORDER BY points DESC LIMIT 5

为什么MySQL返回空结果集?

1 个答案:

答案 0 :(得分:0)

protocol Test1{
    func display()
}
extension Test1{

    func display(){
        print("display Test1")
    }
}

protocol Test2{
    func display()
}
extension Test2{

    func display(){
        print("display Test2")
    }
}
class ViewController: UIViewController,Test1,Test2 {

    var test1 : Test1?
    var test2 : Test2?

    func display() {
        print("display")
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        self.test1 = self
        test1?.display()

        self.test2 = self
        test2?.display()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}

然后尝试你的sql select命令

INSERT INTO Trump SET code='".$name."', type='cja', whendate='".strtotime(Date('Y-m-d')."'

将选择今天插入的所有记录。