Jump to content

deepdiver30

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

deepdiver30's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Code as suggested - this is dev only at the moment <?php //Setup Connection to Database $user="root"; $host="localhost"; $password="password"; $database="DiggersDirect"; $connection = mysql_connect($host,$user,$password) or die ("Could Not Connect"); $db = mysql_select_db ($database,$connection) or die ("Could Not Select"); //Build and Run the Query $query = "SELECT DISTINCT description FROM machines ORDER BY DESCRIPTION"; $result = mysql_query($query) or die ("Could not execute Query"); //Display HTML Select Box echo "<select name='description'>\n"; //Loop to get everything while ($row = mysql_fetch_array($result)) { extract($row); echo "<option value='$description'>$description\n"; } echo "</select>\n"; ?>
  2. I have a PHP Form with a list box. The list box contains value queried from a mySQL database and the control on the form is generated programatically within PHP and echo'd to the screen, which works fine, however I am having trouble trying to find out from the PHP code what the user has selected. I want to be able to record the user's selection in a variable so that i can then perform another query based on the initial selection. Some places I have read, I need to use JavaScript to do this, other places think that I can do this within HTML and somehow echo the results from the query into the HTML via PHP - I'm confused ??? I hope this makes sense, but let me know if you need any clarification, code examples etc. DeepDiver30
×
×
  • 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.