KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to have a condition that will perform some action when the row doesn't exist at all. $stmt = $conn->prepare('SELECT * FROM table WHERE ID=?'); $stmt->bindParam(1, $_GET['id'], PDO::PARAM_INT); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); Tried if (count($row) == 0) and if($stmt->rowCount() < 0) but none of them works.
Tags (comma-separated)
Save Edits
Cancel