Created
July 12, 2017 00:47
-
-
Save lucas-marciano/d92c96a5264dff901b539a22bdb8446c to your computer and use it in GitHub Desktop.
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 | |
class MyUserClass | |
{ | |
public function getUserList() | |
{ | |
$dbconn = new DatabaseConnection('localhost','user','password'); | |
if ($dbconn->connect_error) { | |
// Supondo que a classe DatabaseConnection tenha tratado as funções de erro no banco | |
die("Conexão falhou: " . $dbconn->connect_error); | |
$dbconn->close(); | |
} | |
$results = $dbconn->query('select name from user'); | |
sort($results); | |
$dbconn->close(); | |
return $results; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment