Page 1 of 1

PHP Mysql best practise

Posted: Thu Oct 03, 2013 5:01 am
by adrianharris
Good day all
I would like to know what your thoughts are for the following:
I have 2 tables tb_serials and tb_temp_serials. The user scans in the serial number and it writes it to temp_serials, which gets displayed on reload in a table.
When he is done scanning he clicks finish and it copies the serials to the tb_serials and clears the tb_temp_serials.

I am positive this is not the right way for me to do it, and if there are more then one user scanning serials it cause an issues. Obviously i can't create 10 tb_temp_serials tables.

What would your suggestions be in this regards?

Any help would be most appreciated.

Thanks!

Adrian

Re: PHP Mysql best practise

Posted: Thu Oct 03, 2013 6:37 am
by Celauran
What is the purpose of this temporary table? What are you trying to achieve?

Re: PHP Mysql best practise

Posted: Thu Oct 03, 2013 4:48 pm
by Christopher
adrianharris wrote:I am positive this is not the right way for me to do it, and if there are more then one user scanning serials it cause an issues.
Correct, this is not the right way to do it! :)

A better plan would be: The user scans in the serial number which gets displayed on reload. I assume that the serial number is form data. User confirms the serial number is correct and clicks finish. The serial number is saved to the tb_serials table.

Tell us more about how the scan is done.

Re: PHP Mysql best practise

Posted: Wed Oct 23, 2013 3:19 pm
by BDKR
I agree with Christopher. Knowing how the scan is done would be great.

That said, if you just want to allow the user to confirm that the entered information is correct, why can't you keep this in a session until he's finished confirming the entries?