代码如下,运行并没有出错,但是就是没有创建表try{
$pdo = new PDO('mysql:host:localhost;dbname=test','root','136189');
} catch(PDOException $e) {
echo $e->getMessage();
}
$sql=<<<STR
CREATE TABLE IF NOT EXISTS users(
id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(20) UNIQUE NOT NULL,
password CHAR(32) NOT NULL,
email VARCHAR(30) NOT NULL
);
STR;
$a = $pdo->exec($sql);
添加回答
举报
0/150
提交
取消