ID
*
*/
if (!empty($_GET['id'])) {
try {
require "../config.php";
require "../common.php";
$connection = new PDO($dsn, $username, $password, $options);
if (!empty($_GET['id'])) {
$sql = "SELECT *
FROM tblprojekte
WHERE ProjektID = :id";
$id = $_GET['id'];
$statement = $connection->prepare($sql);
$statement->bindParam(':id', $id, PDO::PARAM_STR);
$statement->execute();
$result = $statement->fetchAll();
}
// if (empty($_POST['id'])) {
// $sql = "SELECT *
// FROM tblprojekte
// ORDER by Kursjahr DESC";
// $statement = $connection->prepare($sql);
// $statement->execute();
// $result = $statement->fetchAll();
// }
//$result = $statement->fetchAll();
} catch(PDOException $error) {
echo $sql . "
" . $error->getMessage();
}
}
function myTruncate2($string, $limit, $break="/", $pad="...")
{
// return with no change if string is shorter than $limit
if(strlen($string) <= $limit) return $string;
$string = substr($string, 0, $limit);
if(false !== ($breakpoint = strrpos($string, $break))) {
$string = substr($string, 0, $breakpoint);
}
return $string . $pad;
}
?>