using (-) dash in mysql table name(在 mysql 表名中使用 (-) 破折号)
本文介绍了在 mysql 表名中使用 (-) 破折号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想备份我的数据库时出错
There is an error while i want to backup my database
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-01-000001' at line 1
SELECT * FROM temp_01-01-000001
Filename: F:\xampp\htdocs\erp_zaara\system\database\DB_driver.php
Line Number: 330
有没有办法用表名(temp_01-01-000001)解决这个问题.
Is there any way to solve this prob with the table name (temp_01-01-000001).
推荐答案
您可以编辑文件/system/database/drivers/mysql/mysql_utility.php 的第 132 行
You could edit line 132 of the file /system/database/drivers/mysql/mysql_utility.php
来自:
$query = $this->db->query("SELECT * FROM $table");
致:
$query = $this->db->query("SELECT * FROM `$table`");
这篇关于在 mysql 表名中使用 (-) 破折号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
编程基础网
本文标题为:在 mysql 表名中使用 (-) 破折号
基础教程推荐
猜你喜欢
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 在 SQL 中连接多个表 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 无法解决整理冲突 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
