Created
August 10, 2017 07:32
-
-
Save Danilovonline/7b0d055e3c39f399a7704251363c08d5 to your computer and use it in GitHub Desktop.
PDO: get one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sql = " | |
select | |
v | |
from | |
table | |
where | |
id = :id | |
LIMIT 0, 1 | |
"; | |
$q = $this->pdo->prepare($sql); | |
$q->execute(array(':id' => $id)); | |
$v = $q->fetchColumn(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment