Basic Order form Using mysql database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zacthespack
Forum Newbie
Posts: 16
Joined: Mon Oct 11, 2010 9:08 am

Basic Order form Using mysql database

Post 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.
litebearer
Forum Contributor
Posts: 194
Joined: Sat Mar 27, 2004 5:54 am

Re: Basic Order form Using mysql database

Post by litebearer »

Look into 'autocomplete'.

Here are some sites to get you started...

http://www.google.com/#pq=php%20autofil ... 16&bih=606
zacthespack
Forum Newbie
Posts: 16
Joined: Mon Oct 11, 2010 9:08 am

Re: Basic Order form Using mysql database

Post by zacthespack »

litebearer wrote:Look into 'autocomplete'.

Here are some sites to get you started...

http://www.google.com/#pq=php%20autofil ... 16&bih=606
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.
zacthespack
Forum Newbie
Posts: 16
Joined: Mon Oct 11, 2010 9:08 am

Re: Basic Order form Using mysql database

Post by zacthespack »

*bump* anyone think they can help me?
SabirAhmed
Forum Newbie
Posts: 23
Joined: Tue Aug 02, 2011 11:56 am

Re: Basic Order form Using mysql database

Post 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.
zacthespack
Forum Newbie
Posts: 16
Joined: Mon Oct 11, 2010 9:08 am

Re: Basic Order form Using mysql database

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