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
- shyra posted »MenuTree Mystery« 19:50h
- dks answered »include a file« 18:22h
- dks answered ».764 -> 1.1.1, Can't add new blocks« 17:33h
- craigh posted »PostCalendar 5.5.0RC1 needs testers and translators« 17:24h
- bartl answered »Upgrading 1.0.2 --> 1.1.1« 15:02h
- Charlie-otb answered »SafeHTML output filter and youtube« 10:02h
- dl7und answered »Adding an "About Us" page« 03:34h
Login
problem with $dbconn->GenId(...)
-
-
- Rank: Moderator
- Registered: 19.03.02
- last visit: 27.06.09
- Posts: 7661
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
--
Visit My homepage and Zikula themes. -
- Rank: Freshman
- Registered: 22.07.02
- last visit: 09.01.07
- Posts: 37
- Moderated by :
- Support
