我想在最后一列我想要添加这些列之后在现有数据库表中添加一些列... scritp对每个人都是可用的,所以不确定最后一列是什么。
$DB_Column = array (
'About_Me' => "About",
'Avatar' => "Avatar",
'Clan_Tag' => "Clan",
'Month' => "Month",
'Day' => "Day",
'Year' => "Year",
'Website' => "Website",
'Website_Link' => "Link",
'Website_Link1' => "Link1",
'Email_Address' => "Email"
);
$Database->exec('ALTER TABLE '.$DB_Table.'
ADD COLUMN '.$DB_Column['About_Me'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Avatar'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Clan_Tag'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Month'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Day'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Year'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Website'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Website_Link'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Website_Link1'].' VARCHAR(255),
ADD COLUMN '.$DB_Column['Email_Address'].' VARCHAR(255)
');
出现此错误:
致命错误:未捕获的异常' PDOException'与消息 ' SQLSTATE [HY000]:一般错误:1接近",":语法错误'在 C:\ xampp \ htdocs \ Webstats \ Functions.php:30堆栈跟踪:#0 C:\ xampp \ htdocs \ Webstats \ Functions.php(30):PDO-> exec(' ALTER TABLE RCO ......')#1 C:\ xampp \ htdocs \ Webstats \ Index.php(3): 要求(' C:\ xampp \ htdocs ...')#2 {main}投入 第30行的C:\ xampp \ htdocs \ Webstats \ Functions.php