这个针对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);
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);
...全文
相关推荐
PostgreSQL与MySql比较
- **PostgreSQL**则有着更为复杂的发展历程,强调功能完备性和标准化。##### 3.2 PostgreSQL特性和功能- **高级查询语言**:支持复杂查询,如窗口函数、递归查询等。
MySQL和PostgreSQL的比较
**数据加密**: - MySQL 可以在表级别设置加密,使用 `AES_ENCRYPT` 和 `AES_DECRYPT` 函数。
mysql转换postgresql工具
国外大牛写的一个mysql数据库转换postgresql的脚本。亲试可以无错误运行。
mysql postgresql Greenplum 实时同步
**支持多种数据源**:当前支持MySQL、PostgreSQL和MongoDB等数据源。4.
PostgreSQL与MySQL比较
然而,PostgreSQL支持更多的约束类型,包括检查约束和排他约束等。存储过程和用户定义函数PostgreSQL和MySQL都支持存储过程和用户定义函数。


基础编程
