Counting the number of results returned by a database query in Codeigniter

后端 未结 6 1738
无人及你
无人及你 2021-01-12 15:53

I am not having much luck detecting when a database query in Codeigniter returns zero results. I have had a good read of the notes on the PHP count function but am none the

6条回答
  •  情话喂你
    2021-01-12 16:20

    If you put count($result) in if statement then when it succeds, it returns only 1.

    You can try $query->num_rows() in a different way.

提交回复
热议问题