1
jmass
MySql Catch22 - Please Advise
  • 2004/2/18 16:11

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


Hello!

I am inserting a record into a MySQL table called ticketdata that has one unique id field - TicketID (int auto increment)

After I insert it, I would like to automaticly insert another record into a different table called updatedata. This table has its own unique id field - UpdateID (int auto increment) but also has a field ParentTicketID to link it to Ticket record.

How can I insert a new Ticket record, and then immediatly insert an Update record, when I do not know the ParentTicketID?

Any help would be appreciated!

JMass

2
DonXoop
Re: MySql Catch22 - Please Advise

LAST_INSERT_ID() (mysql) will tell you what the auto increment value was.

3
Mithrandir
Re: MySql Catch22 - Please Advise

$xoopsDB->getInsertId() will return the value of the last database insertion.

4
jmass
Re: MySql Catch22 - Please Advise
  • 2004/2/18 16:44

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


I tried to make this work... Could you give me a syntax example?

Thanks,

JMass

5
jmass
Re: MySql Catch22 - Please Advise
  • 2004/2/18 16:46

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


Mithrandir.... You are the MAN!!!

Thanks!

JMass

6
Mithrandir
Re: MySql Catch22 - Please Advise

Anytime

[size=x-small]wow - 999 posts.... should probably get a life [/size]

Login

Who's Online

1078 user(s) are online (251 user(s) are browsing Support Forums)


Members: 0


Guests: 1078


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