Jump to content

Help plz: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/hkdropbo/public_html/Register.php on line 28


Huvvud

Recommended Posts

Im having a problem with this, if anyone could help i would be greatful :)

 

 

 

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/hkdropbo/public_html/Register.php on line 28

 

 

<?php
require('config.php');
 
if(isset($_POST['submit'])){
 
// perform the verification
 
$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
 
if($email1 == $email2) {
if($pass1 == $pass2){
//all good, carry on
 
$name = mysql_escape_string($_POST['name']);
$lname = mysql_escape_string($_POST['lname']);
$uname = mysql_escape_string($_POST['uname']);
$email1 = mysql_escape_string($email1);
$email2 = mysql_escape_string($email2);
$pass1 = mysql_escape_string($pass1);
$pass2 = mysql_escape_string($pass2);
 
 
//////// 28.-----------
 
 
 
$pass1 = md5($pass1);
//kollar så ingen annan användare med samma användarnamn finns
$sql = mysql_query("SELECT * FROM `users` WHERE `uname` = '$uname'");
if(mysql_num_rows($sql) >0){
echo "Sorry, that user already exists.";
exit();
}
 
//////////////////28.--------------
 
mysql_query("INSERT INTO `users` (`id`, `name`, `lname`, `uname`, `email`, `pass`) VALUES (NULL, '$name', '$lname', '$uname', '$email1', '$pass1')");
 
 
 
}else{
echo "Sorry, your passwords do not match.<br>";
exit();
}
 
}else{
 
include "regform.php";
//$form = <<<EOT
 
 
//EOT;
//echo $form;
}}
 
?>

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.