php pgsql查询关于表名大小写敏感问题笔记

    $conn_string = "host=xxxx port=5432 dbname=MQS user=postgres password=";
    $dbconn4 = pg_connect($conn_string) or die('connection failed');

    $query  =  'select * From UserNumber limit 1'; //Query failed: ERROR: relation "usernumber" does not existLINE 1: select * From UserNumber limit 1

    $query  =  'select * From "UserNumber" limit 1';//必须带"“双引号

    $result =  pg_query($query)  or  die( 'Query  failed: ' .  pg_last_error());

    var_dump($line = pg_fetch_array($result, null, PGSQL_ASSOC));

怕忘记

你可能感兴趣的:(php pgsql查询关于表名大小写敏感问题笔记)