【问题标题】:Finding if table exists or not in MySQL with codeIgniter?使用codeIgniter在MySQL中查找表是否存在?
【发布时间】:2018-02-13 21:37:40
【问题描述】:

我想检查数据库中是否存在 MySQL 表。我正在使用 CodeIgniter 3.* v

 if($this->db->query("SELECT * FROM `$table` Limit 1")->result() == TRUE){
    #next process if table found    
    }else{
    #display error
    }

我正在How can I check if a MySQL table exists with PHP?寻找解决方案

【问题讨论】:

标签: php mysql codeigniter


【解决方案1】:

试试这个

if ($this->db->table_exists($table) )
{
  // table exists some code run query
}
else
{
  // table does not exist
}

【讨论】:

  • 你为什么停止使用你的昵称 Woflgang1983?我只是想知道,因为我记得你的头像和昵称,因为我们交换了一些 Q/A 很长一段时间......
  • @Vickel 从那个昵称中休息一段时间,直到可能想出更好的东西或者我可能会回去。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-03-24
  • 1970-01-01
  • 1970-01-01
  • 2014-10-15
  • 2011-09-19
  • 1970-01-01
相关资源
最近更新 更多