mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-03 11:59:29 +00:00
ngGrid
This commit is contained in:
@@ -63,6 +63,7 @@ abstract class db extends basis
|
||||
abstract function db_add_param($var, $type=FHC_STRING, $nullable=true);
|
||||
abstract function db_parse_bool($var);
|
||||
abstract function db_implode4SQL($var);
|
||||
abstract function db_getResultJSON($result = null);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,6 +126,30 @@ class basis_db extends db
|
||||
}
|
||||
}
|
||||
|
||||
public function db_getResultJSON($result = null)
|
||||
{
|
||||
$rows=array();
|
||||
if(is_null($result))
|
||||
{
|
||||
while($r = pg_fetch_assoc($this->db_result))
|
||||
$rows[] = $r;
|
||||
|
||||
//print json_encode($rows);
|
||||
}
|
||||
else
|
||||
{
|
||||
pg_result_seek($result, 0);
|
||||
//var_dump($result);
|
||||
while($r = pg_fetch_assoc($result))
|
||||
{
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
//print json_encode($rows);
|
||||
}
|
||||
return json_encode($rows);
|
||||
}
|
||||
|
||||
public function db_last_error()
|
||||
{
|
||||
return pg_last_error();
|
||||
|
||||
Reference in New Issue
Block a user