Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードは、データベース上のテーブルをチェックします。
function checkdbexists(){ global $krdb; return $krdb->query("show tables"); }
「systems」というテーブルが存在するかどうかを確認し、存在する場合は 1 を返し、存在しない場合は null または 0 を返します。
あなたが使用することができます
array_search('system',$krb->query('show tables')->fetch())!==false;
select 1 from information_schema.tables where table_name = 'systems' limit 1