Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/export/www/vhosts/funnetwork/hosting/ultimatum/test/members/register.php on line 27
Warning:mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/export/www/vhosts/funnetwork/hosting/ultimatum/test/members/register.php on line 27
(je registreert wel
en heb deze ook een regel hoger voor username alleen dan krijg ik geen error
<?php
include 'config.php'; // config includen
if($_SERVER['REQUEST_METHOD'] == "POST")
{
$name = $_POST["name"];
$pass = $_POST["pass"];
$cpass = $_POST["cpass"];
$mail = $_POST["mail"];
if ($name==NULL)
{
echo "You have to choose an username";
}
elseif ($pass==NULL)
{
echo "You have to enter a password";
}
elseif ($cpass==NULL)
{
echo "You have to confirm your password";
}
elseif ($mail==NULL)
{
echo "You have to enter an email address";
}
elseif ($pass!=$cpass)
{
echo "Passwords must be the same";
}
else
{
$user = mysql_query("SELECT name FROM members WHERE name='".$name."'") or die(mysql_error());
$user_exist = mysql_num_rows($user);
$email = mysql_query("SELECT mail FROM members WHERE mail='".$mail."'")or die(mysql_error());
$mail_exist = mysql_num_rows($mail);
if ($user_exist > 0)
{
echo "That username is already taken";
}
elseif ($mail_exist > 0)
{
echo "That email address is already in use";
}
else
{
mysql_query("INSERT INTO members (name, pass, mail) VALUES ('".$name."', '".$pass."', '".$mail."')") or die( mysql_error());
echo "The user ".$name." has succesfully created";
}
}
}
?>
@ bigbug, nope fout is er niet uit
@ cracker, kheb wel gelijk
@ admin, hoop dat deze link niet illegaal is
@ all, check hier is het script live, mss dat jullie het dan snappe
<?
$user = mysql_query("SELECT * FROM members WHERE name='".$name."'");
$user_exist = mysql_num_rows($user);
$email = mysql_query("SELECT * FROM members WHERE mail='".$mail."'");
?>
<?
$user=mysql_query("SELECT * FROM members WHERE name='".$name."'");