Jump to content

select


kendris
 Share

Recommended Posts

 

<html>


<?php include "overallheader.php" ?>
<div id ='container'>


<div id ='content'>


<div id='navBar'>
<?php include "navbar.php"?>
</div>
<div id='userinfo'>




<?php








session_start();








if (isset($_SESSION['username']))
{


$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }


mysql_select_db("login", $con);








mysql_close($con);
}
else
die("You must be logged in <a href='index.php'>Back</a>");








?>












<?php $con = mysql_connect("localhost","root","");
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }
mysql_select_db("login", $con);
$result=mysql_query('SELECT eventname FROM event');
$result = mysql_query("SELECT * FROM event");
 ?>






</div>






<select name="listbox" size="5" onchange>
<?php


$tester=mysql_query('SELECT eventname FROM event ORDER BY eventname ASC');
while($row = mysql_fetch_array($tester))
  {
  echo "<option>" . $row['eventname'] . "</option>"  ;


  }
  ?>




</select>
<select name="price" size="5">




</select>
<select name="price" size="5">
 <?php


$location=mysql_query('SELECT location FROM event');
while($row = mysql_fetch_array($location))
  {
  echo "<option>" . $row['location'] . "</option>"  ;


  }
  ?>
</div>
</div>










</html>
 

Basically I'm looking for a way to make this dynamic, so if an option from the first select it will display options in a second table but for each select it will generate the correct listings.

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

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.

 Share

×
×
  • 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.