catch duplicate

master
Helge 2022-01-12 22:23:31 +01:00
parent 9dd44ababc
commit f742d5effd
1 changed files with 13 additions and 6 deletions

View File

@ -50,7 +50,14 @@ class dbLinkHandler
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
if ($e->errorInfo[1] == 1062)
{
echo 'haaaaaa<br><br>';
}
else
{
echo $e->getMessage();
}
}
}
@ -65,11 +72,11 @@ class dbLinkHandler
public function getList()
{
// Mit verschachtelten Arrays optimieren!! Array schlüssel id enthält array mit schlüssel link_id, link_name, etc (repräsentiert datensatz)
$list = array();
$sql = "SELECT * FROM link";
return $this->pdo->query($sql);
//$sql = "SELECT * FROM link";
$statement = $this->pdo->prepare("SELECT * FROM link");
$statement->execute();
//return $this->pdo->query($sql);
return $statement->fetch;
}
}
?>