PhoenixDown
Programmer
I'm using this in my install.php file:
If there is no admins, it adds one, however, if I would like to add more, it doesn't add them. The table should be something like:
Can someone please show me what's wrong? Thank you.
Code:
DROP TABLE IF EXISTS guestbook_admins;
CREATE TABLE guestbook_admins (
adminid smallint(5) NOT NULL auto_increment,
username varchar(150) NOT NULL default '',
password varchar(150) NOT NULL default '',
PRIMARY KEY (adminid)
) TYPE=MyISAM;[code]
It creates the table correctly. Now, this is what I have in my admin.php file:
[code]include 'data/config.php';
$dbh = mysql_connect($server,$dbusername,$dbpassword) or die ('Cannot connect to database.');
mysql_select_db($dbase,$dbh) or die ('Cannot select database. Make sure data/config.php exists.');
$err = mysql_error();
if ($err){
echo CPMessage("Error in database: $err");
}
$query="INSERT INTO guestbook_admins VALUES
(1,'$Username','$Password')";
mysql_query($query);
If there is no admins, it adds one, however, if I would like to add more, it doesn't add them. The table should be something like:
Code:
1 test tset
2 asdf fdsa
3. tset test
Can someone please show me what's wrong? Thank you.