url as primary
parent
235f2188d2
commit
9dd44ababc
|
@ -23,6 +23,6 @@ if ($_POST["linkName"] != "" AND $_POST["linkUrl"] != "")
|
||||||
|
|
||||||
foreach ($db->getListReverse() as $link)
|
foreach ($db->getListReverse() as $link)
|
||||||
{
|
{
|
||||||
echo $link['link_id'].': <a href="'.$link['link_url'].'" target="_blank">'.$link['link_name'].'</a><br>';
|
echo '<a href="'.$link['link_url'].'" target="_blank">'.$link['link_name'].'</a><br>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
5
link.php
5
link.php
|
@ -24,8 +24,7 @@ class dbLinkHandler
|
||||||
// Tabelle link erstellen, falls nicht vorhanden
|
// Tabelle link erstellen, falls nicht vorhanden
|
||||||
|
|
||||||
$sql = 'CREATE TABLE IF NOT EXISTS link (
|
$sql = 'CREATE TABLE IF NOT EXISTS link (
|
||||||
link_id BIGINT(18) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
link_url VARCHAR(50) NOT NULL PRIMARY KEY,
|
||||||
link_url VARCHAR(50) NOT NULL,
|
|
||||||
link_name VARCHAR(100),
|
link_name VARCHAR(100),
|
||||||
reg_date TIMESTAMP
|
reg_date TIMESTAMP
|
||||||
)';
|
)';
|
||||||
|
@ -59,7 +58,7 @@ class dbLinkHandler
|
||||||
{
|
{
|
||||||
// Mit verschachtelten Arrays optimieren!! Array schlüssel id enthält array mit schlüssel link_id, link_name, etc (repräsentiert datensatz)
|
// Mit verschachtelten Arrays optimieren!! Array schlüssel id enthält array mit schlüssel link_id, link_name, etc (repräsentiert datensatz)
|
||||||
$list = array();
|
$list = array();
|
||||||
$sql = "SELECT * FROM link ORDER BY link_id DESC";
|
$sql = "SELECT * FROM link ORDER BY link_name DESC";
|
||||||
|
|
||||||
return $this->pdo->query($sql);
|
return $this->pdo->query($sql);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue