小编Ann*_*na 的帖子

Php PDO rowCount() return wrong result

I have a function for getting path in a tree structure data.

According to my table in DB, root should get no result when I query sub_id='root_id'

When I just pass the root the rowCount return correct result which is 0. However when I pass a node from lower rank(3rd), in the end of the recursive which is root, rowCount return 1?

PS

I use Mysql as DB

This is my table

main_id | sub_id
----------------    
    1   |    2 …
Run Code Online (Sandbox Code Playgroud)

php mysql pdo

0
推荐指数
1
解决办法
4838
查看次数

标签 统计

mysql ×1

pdo ×1

php ×1