Hi,
I'm sorry if this is answered already but I'm such a newbie at programming that I apperantly can't formulate my problem to find an answer! :-/
Here goes:
I have a table filled with data. I want a user to be able to select via a dropdown list what row he/she wants to look at.
So when an option is selected in the dropdown i want one div showing the first ten columns wich are descriptives of that row. then in the next div below i want the next ten columns listed.
I woud then want if possible have four options (buttons) like a menu wich wich when pressed updates the second div to show the next ten columns (columns 21-30) and so on. makes sense? :)
Here I got the dropdown showing the right rows (which is dependant on who the user is and what he selected earlier)
I got two problems with this,
1. Is that when i select an option it reloads the page and shows the initial value instead of the choosen value.
2. I don't know how to proceed and use the input to show the relevant column values!
and a 3. as well :) In my simple mind I would use the dropdown input to use for the buttons to show the next ten values and so on. but then I have to have the input from the dropdown...
the code for my dropdown is as follows:
<form action="" method="post">
<label for="your_select"><select id="your_select" name="id" onChange="this.form.submit()">
<?php
$result12 = mysql_query("SELECT foretag FROM users
WHERE username ='$session->username'");
$rows = mysql_fetch_array( $result12 );
$test = $rows['foretag'];
$sql = "SELECT * FROM matningar WHERE foretag = '$test' AND matningstyp ='rst'";
$result = mysql_query($sql) or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
$namn=$row["namn"];
$foretag=$row["foretag"];
$options.="<OPTION VALUE=\"$foretag\">".$namn.'</option>';
}
?>
<? echo $options ?>
</select>
</form>
Anybody out there who could pity this fool :) Any help or suggestions are greatly welcomed!
Cheers
AddiGraddi