[SOLVED] V7.001 problems with MYSQL last_insert_id

Hello,

again there are problems with the last id of an inserted record in a mysql database.

Example :
Primary key of a table is {record_id}

In the OnAfterInsert event of a form in V6 the value {record_id} contains the last created value of the inserted record in mysql.
In V6 no problem … in V7 {record_id} returns 0 !!!

The primary key of the table is defined as integer - autoincrement.

I posted this bug to support BEFORE 3 DAYS (PAID SUPPORT) BUT GET NO ANSWER. THAT’S NOT FUNNY.

Regards
Uwe Pfeiffer

Hello,

Please send me a pm with the ticket ID.

I have reported this issue to our bugs team for further testing.

regards,
Bernhard Bernsmann

Hi Pfeiffer,
I dont have problems getting the last id in sc7, here is an example with 2 ways to get the same result:
Screenshot
http://goo.gl/NryYL

[SIZE=5]Example to get Last insert id[/SIZE]


sc_lookup(rs, "SELECT LAST_INSERT_ID()");
echo "SC LastID:".{your_field_id};
echo "MySQL LastID:".{rs[0][0]};

Hello,
you are right. The problem was caused by the problem with upload files… so my id was 0. But this is a problem depending on upload error.
So SC V7 is handling last_id correctly… thank’s for your answer.

Regards
Uwe