1
tvn3015
Automatically create the next sequence ID Help?
  • 2009/3/19 21:42

  • tvn3015

  • Just popping in

  • Posts: 53

  • Since: 2007/4/18


I am trying to get a new sequence ID generated and I believed the following code will do it but somehow the $newid always = 0 (I thin it should be 8 because in the table "DanhGia_Phebinh" I have 7 rows already.
$newid = $xoopsDB->genId($xoopsDB->prefix("DanhGia_Phebinh")."_phebinhid_seq");

Any help would be appreciated!

TVN
http://www.XoopsViet.com - Xoops for Vietnamese

2
ghia
Re: Automatically create the next sequence ID Help?
  • 2009/3/19 21:57

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


It is a function for having compatibility with older versions. It will always return zero.
If you want an automatic ID, use an auto-increment field in your database.

3
tvn3015
Re: Automatically create the next sequence ID Help?
  • 2009/3/19 23:19

  • tvn3015

  • Just popping in

  • Posts: 53

  • Since: 2007/4/18


Thank you ghia for your reply, I got it working now.
http://www.XoopsViet.com - Xoops for Vietnamese

Login

Who's Online

77 user(s) are online (45 user(s) are browsing Support Forums)


Members: 0


Guests: 77


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits