0
我有两个模式,一个叫public,另一个叫SIEM。 我想从SIEM模式打印表格,但它不打印任何东西。 如何选择我想要打印表格的模式?如何从Postgresql数据库中选择我想要的模式?
$query = "SELECT * from Maquina222";
$result = pg_query($conn,$query);
$i = 0;
echo '<html><body><table><tr>';
while ($i < pg_num_fields($result))
{
$fieldName = pg_field_name($result, $i);
echo '<td>' . $fieldName . '</td>';
$i = $i + 1;
}
echo '</tr>';
$i = 0;
while ($row = pg_fetch_row($result))
{
echo '<tr>';
$count = count($row);
$y = 0;
while ($y < $count)
{
$c_row = current($row);
echo '<td>' . $c_row . '</td>';
next($row);
$y = $y + 1;
}
echo '</tr>';
$i = $i + 1;
}
pg_free_result($result);
echo '</table></body></html>';
当你说'添加模式到PATH时,你是什么意思?你的意思是将SET search_path = public,SIEM添加到我的php代码中? – 2014-10-29 21:23:24