Forum

Mathieu Roll
Keymaster
    Has successfully completed the online course Introduction
    Has successfully completed the online course Intermediate (200)
    Has successfully completed the online course Advanced (300)
    Has successfully completed the online course Basics (100)
6 years, 1 month ago #15624
Up
0
Down
::

Hi,

the problem is that Simplifier is generating a new session each time you call the connector.

so you can’t use the last inserted methods because they are pointing on the session wich is a new one and so you will always get 0 as last inserted id.

with the method chris gave you he is always reading the highest number in the datebase so its not session based.

so yes if an other user inserts something at the same time you will get his id.

a better way to get the id is by using the max function. this will save some performance.

SELECT MAX(id) AS id FROM test;

but same here you will always get the latest id from any user.