如何在这些语句中添加名为ID的自动递增列:
$sql = "CREATE TABLE IF NOT EXISTS ".$username." (uid varchar(255), tweet varchar(255))";
$alter = "ALTER TABLE ".$username." ADD UNIQUE (uid)";
由于
答案 0 :(得分:1)
$sql = "CREATE TABLE IF NOT EXISTS ".$username." (ID int not null auto_increment primary key, uid varchar(255), tweet varchar(255))";
答案 1 :(得分:1)
我愿意
"CREATE TABLE IF NOT EXISTS ".$username." (id MEDIUMINT AUTO_INCREMENT PRIMARY KEY, uid varchar(255) UNIQUE, tweet varchar(255))";