这个针对mysql的函数怎么转换成针对PostgreSQL的啊??各位高手帮帮我吧!!
下面这个针对mysql的函数怎么转换成针对PostgreSQL的啊??
function tablecount($table, $id, $where = "")
{
$res = query("select count($id) as sum from $table $where");
$row = mysql_fetch_array($res);
return $row['sum'];
}
我将mysql_fetch_array替换成下面的postg_fetch_array,不好用,报错!
function postg_fetch_array($rslt)
{
global $fetch_array_counter;
$fetch_array_counter++;
//计数器加一
return pg_fetch_array($rslt,$fetch_array_counter);