From 1892ebafcb5b992a8b10321e3c2e6621651ec585 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Mon, 31 Oct 2016 02:03:23 +0800 Subject: [PATCH] Random changes. --- admin/login.php | 2 +- index.php | 1 + initialize-tables.md | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 initialize-tables.md diff --git a/admin/login.php b/admin/login.php index efaa439..2e8935d 100644 --- a/admin/login.php +++ b/admin/login.php @@ -41,4 +41,4 @@ if ($sttype!=2) { setcookie("adminlogin", json_encode($arr), time()+86400); header("Location: index.php"); } -?> \ No newline at end of file +?> diff --git a/index.php b/index.php index 0eeb95f..c32be9e 100644 --- a/index.php +++ b/index.php @@ -45,6 +45,7 @@ include 'checklogin.php'; $qry="SELECT * FROM `$mysql_table` ORDER BY `$mysql_table`.`id` DESC LIMIT 0, 30 "; $result=mysqli_query($qry); $iffirst=0; + $newlastid="null"; while ($row = mysqli_fetch_array($result)) { $postlinked = stripslashes($row["txt"]); echo '
'.$postlinked.'
'.$row["tim"].'
'; diff --git a/initialize-tables.md b/initialize-tables.md new file mode 100644 index 0000000..6b9825a --- /dev/null +++ b/initialize-tables.md @@ -0,0 +1,10 @@ + +Log in to your MySQL server, then run the following: + +``` +CREATE TABLE microblog ( +id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, +txt VARCHAR(240) NOT NULL, +tim VARCHAR(20) NOT NULL +) +```