Jump to content

Checking mySQL DB?


Kyle123

Recommended Posts

<?
include("config.php");
if(isset($_GET['username']) and ($_GET['password']) and ($_GET['hwid'])){
$username = $_GET['username'];
$password = md5($_GET['password']);

$query=mysql_query("SELECT banned FROM `members` WHERE `login`='$username'");
$result = mysql_num_rows($query);
$outcome = ($result > 0) ? 'true' : 'false';
echo $outcome;
}
?>

 

I think the last bit is all wrong.

Link to comment
https://forums.phpfreaks.com/topic/253947-checking-mysql-db/#findComment-1301844
Share on other sites

Try this:

 

include("config.php");
if(isset($_GET['username']) and ($_GET['password']) and ($_GET['hwid'])){
   $username = $_GET['username'];
   $password = md5($_GET['password']);

$sql = "SELECT banned FROM `members` WHERE `login`='$username'";
$query=mysql_query($sql) or exit("ERROR: " . mysql_error() . "<br>QUERY: " . $sql);
$result = mysql_num_rows($query);
$outcome = ($result > 0) ? 'true' : 'false';
echo $outcome;
}

Link to comment
https://forums.phpfreaks.com/topic/253947-checking-mysql-db/#findComment-1301847
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.