Posted by:
SkareCrow
(---.dhcp.wnch.wa.charter.com)
Here is a small peice of code I just made for you.
Hope it helps you.
<?PHP
$host = "localhost";
$user = "root";
$pass = "";
$db = "";
mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
if (isset($_GET['user_name'])) {
$username = mysql_real_escape_string($_GET['user_name']);
$query = mysql_query("SELECT * FROM members WHERE user_name='".$user_name."' LIMIT 1"
or die(mysql_error());
if (mysql_num_rows($query) > 0) {
$row = mysql_fetch_assoc($query);
echo "The username {$row['user_name']} exists.<br> Other information about this person.";
print_r($row);
} else {
echo "The username {$user_name} does not exist.";
}
}
?>
<form action='<?PHP echo $_SERVER['PHP_SELF']; ?>' method='get'>
<input type='text' name='user_name'>
<input type='submit' value='Search User'>
</form>