Last active
September 12, 2020 08:12
-
-
Save BMU-Verlag/032831f896f54a0a0187c5bdc8246c5c 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 | |
$sql = "SELECT co_date FROM os_complaints WHERE co_id = 1;"; | |
try | |
{ | |
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc"); | |
$return = $dbh->query($sql); | |
$result = $return->fetchAll(PDO::FETCH_ASSOC); | |
print "Complaint date:". $result[0]['r_datum'] ."<br>\n"; | |
$error = $dbh->errorInfo(); | |
if ($error[0] > 0) | |
{ | |
print "Error Code: " .$error[1]."<br>".$error[2]; | |
} | |
$dbh = null; | |
} | |
catch(PDOException $e) | |
{ | |
print $e->getMessage(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment