I am brand new to this whole gig. I just installed yesterday, and have created databases and tables and such. I do not have a book or much to reference except for web examples. I want to have an input box to search a mysql database. I have gathered bits and pieces of code and put together this script. It obviously does not work from the looks of it, but I was hoping to get some guidance. I hope I am on the right track, but maybe I am far off. I will paste the code in hopes that someone will help me.
thanx
<?php
if ($submit == "click"){
$connection = mysql_connect ("localhost", "root");
$query = "SELECT * FROM pet WHERE name = '$fullname'";
$result = mysql_query($query);
print "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
print "\t<tr>\n";
foreach ($line as $col_value)
{
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
mysql_close($connection);
}
else{
echo "
<html><body>
<form method=\"post\" action=\"bm.php\">
Enter your full name
<input type=\"text\" name=\"fullname\"></input><br>
<input type=\"submit\" name=\"submit\" value=\"click\"></input>
</form>
</body></html>
";
}