这个针对mysql的函数怎么转换成针对PostgreSQL的啊??各位高手帮帮我吧!!

apilove apilove 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
下面这个针对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);
...全文
评论 5
收藏 已收藏
分享
返回顶部
apilove
基础编程 21,889 成员 140,329 内容