0

I have a database that gets data from a card reader, a person that wants to eat uses the card and the info about the person gets in the database, info like id, day, name...

i want to create dropdown lists that will extract data from the database like this:

a dropdown list called Day. when i select day it displays all that eat in that day

a dropdown list called Mounth... one called year...

One caled person... that displays how many days, or the days that the person eate...

If someone can help me...

thank you, and sorry for my english, i`m not english..

3
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

It sounds like you want to use AJAX
read the tutorial at w3schools
when the select menu changes it will change te content in the lower div tag.
however if you want to have multiple selection menus change from other select menus I would recommend the tutorial here

Hope this helps. If you could be a little more specific in what you want i can build your script, however I understand your english isn't perfect.
perhaps Private message me in your language and i'll use google translate :)

0

The below sample loads data from database:

<body>
<select name="select">
<?php
	error_reporting(E_ALL); 
	ini_set("display_errors", 1);
	
	$host = "localhost"; 
	$user = "root"; 
	$pass = ""; 
	$db = "testdb"; 
	$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!"); 
	mysql_select_db($db) or die ("Unable to select database!"); 
	$query = "SELECT country FROM symbols";
	$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
	print("<option select value=\"0\">Select any Option</option>");
	
	if (mysql_num_rows($result) > 0) { 
		 while ($row = mysql_fetch_row($result)) {
			if($row[0]=='India')$dtext = "selected";
			else $dtext = "";
			print("<option $dtext value=\"$row[0]\">$row[0]</option>");
		 }
	}
	else { 
      echo "No rows found!"; 
	} 
	mysql_free_result($result);
	mysql_close($connection);
?>
</select> 
</body>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.