[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] notes/class.base.php, 1.1.2.8
From: |
nomail |
Subject: |
[Phpgroupware-cvs] notes/class.base.php, 1.1.2.8 |
Date: |
Sun, 23 May 2004 14:08:32 -0000 |
Update of /notes
Modified Files:
Branch: proposal-branch
class.base.php
date: 2004/05/07 00:12:34; author: jengo; state: Exp; lines: +5 -11
Log Message:
- Added proper support for last insert id, using the ADODB build in sequences.
This will allow better cross database support.
Currently, MySQL will create a seperate table for each table that uses
sequences, I don't like this. I would prefear to create a
single generic table for sequences on databases that don't have native support
for sequences. For now, this is fine.
=====================================================================
Index: notes/class.base.php
diff -u notes/class.base.php:1.1.2.7 notes/class.base.php:1.1.2.8
--- notes/class.base.php:1.1.2.7 Sun Apr 25 07:22:23 2004
+++ notes/class.base.php Fri May 7 00:12:34 2004
@@ -257,20 +257,14 @@
}
else
{
- $GLOBALS['phpgw']->db->execute("INSERT
INTO phpgw_notes (note_owner,"
+ $note_id =
$GLOBALS['phpgw']->db->genid('phpgw_notes_note_id_seq');
+ $GLOBALS['phpgw']->db->execute("INSERT
INTO phpgw_notes (note_id,note_owner,"
.
"note_access,note_category,note_content,note_dm_type,note_modified,"
- . "note_created) values ('" .
$GLOBALS['phpgw_data']['user']['id']
+ . "note_created) values
($note_id,'" . $GLOBALS['phpgw_data']['user']['id']
. "','" . $args['access'] .
"','" . $args['category']
. "','" . $args['content'] .
"','" . $args['dm_type']
. "',now(),now())");
-
- // This is done like this on purpose,
just in case they add a duplicate
- // or submit the form 2+ times
- $dbresult =
$GLOBALS['phpgw']->db->selectlimit("SELECT note_id FROM phpgw_notes where
note_owner="
- .
$GLOBALS['phpgw_data']['user']['id'] . " AND note_content='"
- . $args['content'] . "' order
by note_created desc",1);
-
- $note_id = $dbresult->fields['note_id'];
+
// If insert works, show this message
then forward them to view the new note
if ($note_id)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] notes/class.base.php, 1.1.2.8,
nomail <=