Can I know what's mistake in here? I have two tables in my database. it is this
I have written the code as search player thing. I'll put the name or userid in the form and it'll process the information of user.
Here is my code
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<form action="" method="post">
Search: <input type="text" name="term" />
<input type="submit" value="Submit" />
</form>
<?php
include('config.php');
if (!empty($_REQUEST['term']))
{
$term = mysql_real_escape_string($_REQUEST['term']);
$sql = " select u.* from users u inner join ranks r ON (u.UserID = r.UserID) where u.UserID = '%" . $term . "%'";
$r_query = mysql_query($sql);
while ($row = mysql_fetch_array($r_query))
{
echo 'Name: ' . $row['Name'];
echo '<br /> Cash: ' . $row['Cash'];
echo '<br /> Score: ' . $row['Score'];
echo '<br /> Race: ' . $row['Race'];
echo '<br /> Horseshoe: ' . $row['Horseshoe'];
}
}
?>
</body>
</html>