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
- Paustian responded to »Different page content under one template (tpl file) based on URL« 06:46 AM
- Guite responded to »Remove contents of nuke_sc_anticracker from Database« 01:30 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
- jmvaughn responded to »PN 0.764 to Zikula 1.1.2 (migration) Internal Server Error« 08. Feb
- eledril created topic »Where can I download BBCode and BBSmile?« 08. Feb
- Paustian responded to »Need Feedback« 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
This list is based on users active over the last 60 minutes.
