Im executing code similar to this:
// first select
$query = $link->prepare("
SELECT id FROM table
WHERE name = ?;");
$param = 'foo';
$query->bindParam(1, $param); // should return 1 row
$query->execute();
echo $query->rowCount(); // displays 0 (??????)
Other example:
// second select
$query = $link->prepare("
SELECT id FROM table
WHERE name = ?;"); // should return 0 rows
$param = 'bar';
$query->bindParam(1, $param);
$query->execute();
echo $query->rowCount(); // displays 1 (?????)
My table:
id | name
---------
1 | foo
I don't understand.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…