Jump to content
zendo

Link listbox with database

Recommended Posts

Hello guys, am new to this forum. I have a question that i'd like some help with, this is part of my dissertation project. So i'm creating a system that will gather hardware parts from the database manually (I have 7 hardware parts for each component which is cpu,gpu,psu,motherboard,ram and case) for each and the user will input the price tag in the listbox ($300-$450) for example and the system will display hardware parts from the database within that price range.

 

How can I link the listbox with the database? And how can I make the total price from hardware parts display depending on what the user pressed?

 

Thanks

Share this post


Link to post
Share on other sites

What listbox? People don't usually enter stuff into a listbox, so I'm curious what listbox you have that allows that

Share this post


Link to post
Share on other sites

What listbox? People don't usually enter stuff into a listbox, so I'm curious what listbox you have that allows that

What do you mean? The html tag with the select option I am reffering to isn't that listbox? And a submit button of course

Share this post


Link to post
Share on other sites

At least we agree on what a listbox is, but you say the user is entering a price into the listbox. How is that possible?

Share this post


Link to post
Share on other sites

Moving on - Trying to figure out what your question is. For what purpose do you want to link your listbox to your database? I'm assuming that you already building the listbox by getting data from the database and looping thru some results to build the option tags. Why do you need a link to the database, or in other words, what are you trying to do once you have it built?

Share this post


Link to post
Share on other sites

Moving on - Trying to figure out what your question is. For what purpose do you want to link your listbox to your database? I'm assuming that you already building the listbox by getting data from the database and looping thru some results to build the option tags. Why do you need a link to the database, or in other words, what are you trying to do once you have it built?

well let's say the listbox has the values

1. $300-$350

2. $351-$450

3. $451-$550

4. $550-$700

7. $700+

 

If the user decides to press the tag number 2 for example I want the system to output hardware components from the database with the price range from $351 to $450

Share this post


Link to post
Share on other sites

Are you looking to display the hardware components as soon as a "listbox" choice is made...or after the form is submitted? Note that if you want to display the hardware components prior to the form being submitted, you'll need to look into a JavaScript / AJAX solution.

Share this post


Link to post
Share on other sites

Are you looking to display the hardware components as soon as a "listbox" choice is made...or after the form is submitted? Note that if you want to display the hardware components prior to the form being submitted, you'll need to look into a JavaScript / AJAX solution.

Well after the form is submitted, am just wondering on how this is achievable and on what I should focus on

Share this post


Link to post
Share on other sites

Ok - now you have made yourself clear. If you re-read your OP you will see how it was confusing.

 

All you really want to do is to click on an item and have that sent to the server for handling. Ok - so you should have this listbox inside a form element and have a submit button for the form that triggers your script. In that script you grab the POST element for your list box (whatever the name= is in the select tag) and validate it to be sure it is correct and then use that value to search your db for whatever info you want to send back to the client in a new output arrangement.

 

Ok?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.