Php signup error(please help)
Please really need help with this. i tried writing a script for a sign up page but anytime i try to sign up, it shows this error message mysql_num_rows(): supplied argument is not a valid MySQL result resource what do i do . Here is the code @ the line the error was referred to
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string(sha1($_POST['password']));
$email = mysql_real_escape_string($_POST['email']);
$avatar = mysql_real_escape_string($_POST['avatar']);
$dn = mysql_num_rows(mysql_query('select id from users where username="'.$username.'"'));
$dn2 = mysql_num_rows(mysql_query('select id from users'));
$id = $dn2+1;
if(mysql_query('insert into users(id, username, password, email, avatar, signup_date) values ('.$id.', "'.$username.'", "'.$password.'", "'.$email.'", "'.$avatar.'", "'.time().'")'))
$form = false;
thanks in advance
You should save your results of a query in a variable, because of this explanation in the return section of the mysql_query function:
I think that might be the problem.
http://www.truereligionoutletcanada.ca/ are more fitted versus the traditional jeans.True Religion Outlet days there are designer jeans to comprehend relaxed fitting.
True Religion Womens Jeans which manufactures designer jeans True Religion Jeans Replay And more branded designer jeansCanada True Religion Mens Jeans the moment are noticed in the marketplace.
The few original designer brands like Jordache, Calvin Klein, and Dittos can also be re-occurring in the market.
|All times are GMT. The time now is 04:48 PM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0