Page 1 of 1
Basic Order form Using mysql database
Posted: Thu Jul 28, 2011 4:24 am
by zacthespack
I am looking for the easiest way to set up a order form in which the user can start to type a product code and the script will then look the item up within the mysql database (which is made up of many tables) and fill in the rest of the product fields on the order forum (e. price, description etc). The user will then need to beable to input how many of a item they want and then have the script work out a final total cost.
There is no need for any payment system the order will simply need to be sent to a email address where it will then be dealt with by our ordering department.
Thank you in advance.
Re: Basic Order form Using mysql database
Posted: Thu Jul 28, 2011 7:23 am
by litebearer
Look into 'autocomplete'.
Here are some sites to get you started...
http://www.google.com/#pq=php%20autofil ... 16&bih=606
Re: Basic Order form Using mysql database
Posted: Thu Jul 28, 2011 8:16 am
by zacthespack
Its a good start thank you, I have found this site
http://www.nodstrum.com/2007/09/19/autocompleter/ which looks to work very nicely, however how would i change this so that once the product code is entered the other fields will auto fill from the database. These will be two other fields Price and description.
Re: Basic Order form Using mysql database
Posted: Tue Aug 09, 2011 6:40 am
by zacthespack
*bump* anyone think they can help me?
Re: Basic Order form Using mysql database
Posted: Tue Aug 09, 2011 7:22 am
by SabirAhmed
however how would i change this so that once the product code is entered the other fields will auto fill from the database. These will be two other fields Price and description.
When you say 'once the product code is entered', do you mean when they input it and press a Submit button, or do you mean as soon as they enter the code.
In order to pull details out a database, PHP itself would need to page to be submitted to the server, and then it will do a MYsql query.
If you want the details to come up as soon as the person inputs the product code, on 'key up' (i.e - without having to press a Submit button), then this would require some sort of use of AJAX probably - PHP alone would probably not be able to do it properly as you'd want.
Re: Basic Order form Using mysql database
Posted: Wed Aug 10, 2011 3:01 am
by zacthespack
SabirAhmed wrote:however how would i change this so that once the product code is entered the other fields will auto fill from the database. These will be two other fields Price and description.
When you say 'once the product code is entered', do you mean when they input it and press a Submit button, or do you mean as soon as they enter the code.
In order to pull details out a database, PHP itself would need to page to be submitted to the server, and then it will do a MYsql query.
If you want the details to come up as soon as the person inputs the product code, on 'key up' (i.e - without having to press a Submit button), then this would require some sort of use of AJAX probably - PHP alone would probably not be able to do it properly as you'd want.
Yes we would need it to so it will fill in the other fields as soon as the text is entered so yes Im guessing AJAX would be required, can anyone help with this? (i know this is a php forum but one can hope)