mysqlConnection.connect((err) => {
if(err){
console.log(err);
}else{
console.log("Connected!")
}
});
app.get("/install", (req,res) => {
let createTable = `CREATE TABLE if not exists Products(
product_id int auto_increment,
product_name varchar(255) not null,
product_price varchar(255) not null,
PRIMARY KEY (product_id)
)`;
mysqlConnection.query(createTable,(err,result,feild)=>{
if(err){
console.log(err);
}
});
res.end(confirm);
console.log("Table successfully created!");
});
当我检查它时,参考错误不断出现在我的浏览器上。如果您知道解决方案,请提供帮助。
尝试使用 YouTube 通过命令提示符和 bash 来修复它,但这没有帮助,也尝试在这里和那里修复代码,但仍然没有用。我正在使用我的 php 管理员在我的浏览器上运行测试?