*** empty log message ***

This commit is contained in:
Miles Lott 2001-11-30 01:13:31 +00:00
parent 1edd9f4331
commit 80edef2307
2 changed files with 12 additions and 5 deletions

View File

@ -56,8 +56,15 @@
function add($data)
{
$sql = "INSERT INTO phpgw_applications (app_name,app_title,app_enabled,app_order) VALUES('"
. addslashes($data['n_app_name']) . "','" . addslashes($data['n_app_title']) . "','"
/* Yes, the sequence should work, but after a mass import in setup (new install)
it does not work on pg
*/
$sql = "SELECT MAX(app_id) from phpgw_applications";
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$app_id = $this->db->f(0) + 1;
$sql = "INSERT INTO phpgw_applications (app_id,app_name,app_title,app_enabled,app_order) VALUES("
. $app_id . ",'" . addslashes($data['n_app_name']) . "','" . addslashes($data['n_app_title']) . "','"
. $data['n_app_status'] . "','" . $data['app_order'] . "')";
$this->db->query($sql,__LINE__,__FILE__);
@ -76,7 +83,7 @@
function exists($app_name)
{
$this->db->query("select count(*) from phpgw_applications where app_name='" . addslashes($app_name) . "'",__LINE__,__FILE__);
$this->db->query("SELECT COUNT(app_name) FROM phpgw_applications WHERE app_name='" . addslashes($app_name) . "'",__LINE__,__FILE__);
$this->db->next_record();
if ($this->db->f(0) != 0)
@ -88,7 +95,7 @@
function app_order()
{
$this->db->query("SELECT (max(app_order)+1) as max from phpgw_applications");
$this->db->query("SELECT (MAX(app_order)+1) AS max FROM phpgw_applications");
$this->db->next_record();
return $this->db->f('max');
}