27.01.2012, 17:37
So im trying to make a PHP status show for the online player login but it always returns 0 rows anyone sees how to fix that?
Thanks in advance
PHP код:
<?
session_start();
if(!session_is_registered(Name)){
header("location:Accounts.php");
}
?>
<html>
<body>
<?php
/* Change next two lines if using online*/
$db="Censored";
$link = mysql_connect('Censored', 'Censored', 'Censored');
if (! $link) die(mysql_error());
mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error());
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$result = mysql_query( "SELECT * FROM Users WHERE Name ='$Name' and Password='$mypassword'" )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<br>";
print "<table width=600 border=1>\n";
print "Name, admin, PosX, PosY, PosZ, Score, Male/Female/Age";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td>$field</td>\n";
print "</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>
</body>
</html>