I have a query that returns the next auto-increment value (id), and I use that value when I'm inserting data in table t_name.
SELECT AUTO_INCREMENT id
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'db_name'
AND TABLE_NAME = 't_name'
But I want that this query gives a different value each time. E.g. Me and my pal are inserting data in db at same time, so I will get one id, he will get another. When I run this query, I want it to give me a different and incremented value each time.
Is it possible? Or do I have to create tables with sequences?