players.php
MySQLMud/www/players.php · 907 B
From the archive MySQLMud.tar.gz
Download the archive « Back to the archive contents
<?
include("config.inc.php");
include("header.inc.php");
$player_name = $_POST['player_name'];
echo "<html>";
echo "<title>Vandagard Player's List</title>";
?>
<h4>Vandagard Player Search</h4>
<form action="players.php" method="post">
</select>
Name: <input name="term" type="text" />
<input type="submit" />
</form>
</body></html>
<?
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM `vand_players`WHERE `name` LIKE CONVERT( _utf8 '" . $term . "' USING latin1 ) COLLATE latin1_swedish_ci";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num)
{
echo $query;
$i++;
$name = mysql_result($result,$i,"name");
$levl = mysql_result($result,$i,"admin_level");
echo "Name: $name";
echo "Level: $levl";
}
?>
</html>