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
- mercromina responded to »error when i try to upgrade to the last version of dizkus module (3.1)« 08:01 PM
- craigh responded to »TagIt 3.0 for Zikula« 03:58 PM
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
problem with $dbconn->GenId(...)
-
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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.
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
