php PDO操作oracle,如何返回sql语句所影响的记录行数?

rowCount() 方法试过好像没用;
下面这个方法也没用$sql = "SELECT COUNT(*) FROM folks";if ($STH = $DBH->query($sql)) { # check the row count if ($STH->fetchColumn() > 0) { # issue a real select here, because there's data! } else { echo "No rows matched the query."; }}

郎朗坤
浏览 800回答 3
3回答

杨魅力

$sql = "select * from folks";$rs = $pdo->prepare($sql);//$rs->exec();$rs->execute();$num = $rs->rowCount();if($num){#}else{#}

慕无忌1623718

$sql = "select count(*) from folks";$rs = $pdo->prepare($sql);$rs->execute();$num = $rs->fetchColumn();echo $num;
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

MySQL