- Moderated by:
- Support Team
-
- rank:
-
Freshman
- registered:
- July 2002
- Status:
- offline
- last visit:
- 09.01.07
- Posts:
- 37
hi,
I use Example module to write a custom module but the $dbconn->GenId(...) always returns 0 (in my module as in Example module).
I saw a hack by Larsneo in :
/includes/classes/adodb/drivers/adodb-mysql.inc.php
and the explanation in:
/includes/classes/adodb/readme_postnuke.txt
But why using $dbconn->GenId(...) if it always return 0 ???
I need to know the item id I insert in database. How to do that without calling GenId() ?
chaKal -
- rank:
-
Moderator
- registered:
- March 2002
- Status:
- offline
- last visit:
- 26.08.08
- Posts:
- 7720
You're recommended to use this code becuase certain databases don't have auto-increment fields but use sequences instead. One example is oracle. However mysql has auto-increment fields so the GenID method of adodb has no effect when used on a mysql DB.
If you follow the example module code further you'll see that the inserted id is calculated later using the PO_Insert_ID method.
-Mark
