Benden
maging ang maganda mamatay
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\zelo\register.php on line 26
here is line 26: $username_exist = mysql_num_rows($checkuser);
Here is the full code,
here is line 26: $username_exist = mysql_num_rows($checkuser);
Here is the full code,
PHP:
<?php
/*
============================================================================
-----ZeloCMS - Built for roleplay hotels.
============================================================================
-----Copyright (C) 2011 Undefiend. All rights reserved.
-----All layouts, scripts and images
============================================================================
-----ZeloCMS is provided "as is"
-----As this is a free release their is no warrenty.
-----ZeloCMS is a free release, Any provit goes to the creator
============================================================================*/
require_once'./include/config.php';
?>
<head>
<title> HabbSpin </title>
<link type="text/css" rel="stylesheet" href="./style/login.css" />
</head>
<?php
$name = $_POST['name'];
$password = md5($_POST['password']);
$checkuser = mysql_query("SELECT username FROM users WHERE username='$username'");
$username_exist = mysql_num_rows($checkuser);
if($username_exist > 0){
echo "I'm sorry but the username you specified has already been taken. Please pick another one.";
unset($username);
include 'register.html';
exit();
}
$query = "INSERT INTO users (name, password)
VALUES('$name', '$password')";
mysql_query($query) or die(mysql_error());
mysql_close();
echo "You have successfully Registered";
?>
<div class="bot">
<?php
include'./include/login_footer.php';
?>
</div>