我想显示我的数据库,但我有这个错误:
警告:pg_query() 期望参数 1 是字符串,资源在
<?php
session_start();
pg_connect("host=localhost port=5432 dbname=base_test user=postgres password=123456") or die('Could not connect: ' . pg_last_error());
$q=pg_query("select timestamp, outdoor, indoor from align_data");
$query=pg_query($q);
$n=pg_num_rows($query);
for($i=0; $i<$n; $i++)
{
$f=pg_fetch_row($query1);
echo("['".$f[0]."', ".$f[1].", ".$f[2]."], ");
}
?>