using (-) dash in mysql table name

前端 未结 2 943
挽巷
挽巷 2020-12-03 06:46

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 t         


        
相关标签:
2条回答
  • 2020-12-03 07:22

    You have to add quotes as your table name contains number. I think the following query will work.

    SELECT * FROM `temp_01-01-000001`
    
    0 讨论(0)
  • 2020-12-03 07:45

    You could edit line 132 of the file /system/database/drivers/mysql/mysql_utility.php

    From:

    $query = $this->db->query("SELECT * FROM $table");
    

    To:

    $query = $this->db->query("SELECT * FROM `$table`");
    
    0 讨论(0)
提交回复
热议问题