PHP Mysql best practise

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
adrianharris
Forum Newbie
Posts: 1
Joined: Thu Oct 03, 2013 12:34 am

PHP Mysql best practise

Post 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
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP Mysql best practise

Post by Celauran »

What is the purpose of this temporary table? What are you trying to achieve?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: PHP Mysql best practise

Post 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.
(#10850)
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Re: PHP Mysql best practise

Post 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?
Post Reply