I am creating a website using php and mysql in which I want to save part of images’ name as article id.
Currently I am taking the article id as “querying the last id from article table and adding one to it”.
I want to know whether this is a right way to do it, because I am giving the article id to images before inserting the actual article to database.
In the worst case scenario I am wondering that what will happen if 10 users are inserting an article at the same time.
Does anyone of you know a proper logic to accomplish this or am I doing the right thing?