|
It's rather unclear exactly what you are asking, but typically this sort of search button does something equivalent to the following: -
The search button is a simple HTML form which sends the results either as GET through the URL or POST (hidden and more secure) to a named script. In a PHP script the name of the text box in the form is gathered as a variable. So if the form text box was named mybox, PHP would pick it up as $mybox. $mybox would equal whatever the user had entered. This variable can then be used in the SQL query on your table. If PHP was accessing a mysql database it would use the function mysql_query and load the results into an array in the form $result = mysql_query("select .... where ... = '$mybox'"). The results are then read with something like
while ($row = mysql_fetch_assoc($result)) {
extract($row); ....
where each field in the select statement is returned as a variable so select name, adresss would now be read row by row as $name, $address. as the rows are read they are formatted for the screen, often in the form of a table so each row could be output as
print "<TR><TD>$name</TD><TD>$adress</TD></TR>
to provide say the address result as a link output something like
print "<TR><TD>$name</TD><TD>$adress</TD></TR><a href=\"http://(web address)/get_addr.php?name=$name&address=$address>$address</a></td></tr>";
This would produce a list of names and addreses with the adress as a link. When the link is clicked it sends $name and $address to the website and the script get_addr.php which then picks the 2 variables up as $name and $address which can then be used in another SQL query. And so it can go on and on.
Bob
|