Created
March 29, 2015 01:46
-
-
Save lfalmeida/62e6d3efbd5cb1dd8dd2 to your computer and use it in GitHub Desktop.
Usando PDO com codeigniter
This file contains 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
<?php | |
$pdo = new PDO('mysql:host=localhost;dbname=itlean', $this->db->username, $this->db->password); | |
$username = 'itlean'; | |
$consulta = $pdo->prepare("SELECT * FROM admin_users WHERE username = :username;"); | |
$consulta->bindParam(':username', $username, PDO::PARAM_STR); | |
$consulta->execute(); | |
while ($linha = $consulta->fetch(PDO::FETCH_OBJ)) { | |
print_r($linha); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment