Mysql 如何修复1064错误
我在尝试连接这两个表时遇到了这个错误 发生数据库错误,错误号:1064 错误:Mysql 如何修复1064错误,mysql,phpmyadmin,Mysql,Phpmyadmin,我在尝试连接这两个表时遇到了这个错误 发生数据库错误,错误号:1064 错误: SELECT order.order_id,order.order_total, customer.first_name,customer.last_name FROM order, customer WHERE order.customer_id=customer.customer_id; 您的SQL语法有错误;检查手册 对应于您的MySQL服务器版本,以便使用正确的语法 近“订单,客户在哪里订单。客户\u i
SELECT order.order_id,order.order_total,
customer.first_name,customer.last_name FROM order, customer WHERE
order.customer_id=customer.customer_id;
您的SQL语法有错误;检查手册
对应于您的MySQL服务器版本,以便使用正确的语法
近“订单,客户在哪里订单。客户\u id=客户。客户\u id”在
第2行
查询:
SELECT order.order_id,order.order_total,
customer.first_name,customer.last_name FROM order, customer WHERE
order.customer_id=customer.customer_id;
文件名:
SELECT order.order_id,order.order_total,
customer.first_name,customer.last_name FROM order, customer WHERE
order.customer_id=customer.customer_id;
D:\xampp\htdocs\computeleconix2\system\database\DB\u driver.php行
电话:330
“ORDER”是SQL中的保留字。您必须使用反引号对其进行报价:
SELECT
`order`.order_id,
`order`.order_total,
customer.first_name, customer.last_name
FROM `order`, customer
WHERE `order`.customer_id=customer.customer_id
每种语言都有一些保留词,我们也称之为关键字。我们不能用这些保留字创建变量 这里的表名是'order',order在mysql中是一个保留字,所以它会生成en错误。你有两个选择
SELECT
`order`.order_id,
`order`.order_total,
customer.first_name, customer.last_name
FROM `order`, customer
WHERE `order`.customer_id=customer.customer_id
SELECT `order`.`order_id`, `order`.`order_total`, `customer`.`first_name`, `customer`.`last_name`
FROM `order`
JOIN `customer` ON
`order`.`customer_id` = `customer`.`customer_id`;
无连接
SELECT `order`.`order_id`, `order`. `order_total`,
`customer`.`first_name`, `customer`.`last_name`
FROM `order`, `customer`
WHERE `order`.`customer_id` = `customer`.`customer_id`;
试着从订单内部加入订单上的客户。客户id=客户。客户id不起作用@Miladinovic