TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-12-2012, 03:31 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Donima4u is on a distinguished road
Default 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.'"'));
if($dn==0)
{
$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
Donima4u is offline  
Reply With Quote
Old 04-12-2012, 04:29 AM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

You should save your results of a query in a variable, because of this explanation in the return section of the mysql_query function:

Quote:
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.
So, if your mysql_query is not successful it returns a FALSE and mysql_num_rows doesn't take that as an argument.

I think that might be the problem.
tony is offline  
Reply With Quote
Old 11-09-2012, 08:03 AM   #3 (permalink)
The Contributor
 
Join Date: Oct 2012
Posts: 46
Thanks: 0
ww628815 is on a distinguished road
Default

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.
ww628815 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get PHP 5. to work? Newbie windows PHP guy DotNetTim Absolute Beginners 11 02-01-2013 11:02 AM
PHP Beginner Guide #1 Hershey Absolute Beginners 1 11-07-2011 10:42 PM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
what are all the subjects in php? sarmenhb General 7 01-21-2008 05:41 PM


All times are GMT. The time now is 06:09 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design