Then you simply need to create a HTML form which sends the data to you PHP script, have your PHP script execute a query on your database and display the results.
If you are having difficulties passing the data from the form, check out this article I wrote on the subject.
If you need to know how to query the database, check out the MySQL Functions, or better yet, the Improved MySQL Extension at php.net
here is the script I created, but when I execute it, nothing comes back in a webpage, it still displays the search button, I am thinking something is not correct in the way I try to display results.
[PHP]<?php
if($_GET["field1"]):
// Connecting, selecting database
$link = mysql_connect('10.10.17.247', 'edefikh', 'changeme')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('InventoryDev') or die('Could not select database');
// Performing SQL query
$query = 'SELECT network.hostname, server.domain, server.manufacturer, server.model, server.chassis, server.slot, server.os, server.osver, server.notes
FROM network
LEFT OUTER JOIN server
ON network.serverid = server.serverid
WHERE ipaddr = '.mysql_escape_string($_GET["ipadd"]);
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
else:
?>
<!-- comments -->
<form method="post" action="test.php">
<input type ="text" name ="ipadd"/>
<input name="button" value="Search" type="SUBMIT"/>
</form>
<?php endif;?>[/PHP]