diff --git a/includes/login.inc b/includes/login.inc index 529ddd8..c39570b 100644 --- a/includes/login.inc +++ b/includes/login.inc @@ -10,7 +10,7 @@ if ( $_COOKIE['session'] ) { // If yes, continue loading page as normal # Attempt login require "dbconnect.php"; - $sql = "SELECT id,username FROM users WHERE username='$_POST[username]' and password=PASSWORD('$_POST[password]')"; + $sql = "SELECT id,username FROM blog_users WHERE username='$_POST[username]' and password=PASSWORD('$_POST[password]')"; $result = mysql_query($sql) or die (mysql_error()); # echo "Results: " . mysql_num_rows($result); // Debugging line diff --git a/install.php b/install.php index b6b42f9..3e4aca8 100644 --- a/install.php +++ b/install.php @@ -26,8 +26,8 @@ if (mysql_error()) { echo "Table 'Blog' created successfully.
"; } -# Try to create 'users' table -$sql = "CREATE TABLE `users` (`id` int(11) NOT NULL AUTO_INCREMENT,`username` varchar(20) NOT NULL,`name` varchar(40) NOT NULL,`password` varchar(64) NOT NULL,`salt` int(64) NOT NULL,`session` int(64), PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; +# Try to create 'blog_users' table +$sql = "CREATE TABLE `blog_users` (`id` int(11) NOT NULL AUTO_INCREMENT,`username` varchar(20) NOT NULL,`name` varchar(40) NOT NULL,`password` varchar(64) NOT NULL,`salt` int(64) NOT NULL,`session` int(64), PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; $result = mysql_query($sql); if (mysql_error()) { echo mysql_error() . ".
"; @@ -36,7 +36,7 @@ if (mysql_error()) { } # Try to create 'admin' user -$sql = "INSERT INTO `users` (`id`, `username`, `name`, `password`, `session`) VALUES (NULL, 'admin', 'Admin', PASSWORD('admin'), RAND(10000), NULL);"; +$sql = "INSERT INTO `blog_users` (`id`, `username`, `name`, `password`, `session`) VALUES (NULL, 'admin', 'Admin', PASSWORD('admin'), RAND(10000), NULL);"; $result = mysql_query($sql); if (mysql_error()) { echo "User 'admin' already exists.
";