Advertisement

08.21.2008 at 05:05AM PDT, ID: 23666359
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.1

mysql_num_rows(): supplied argument is not a valid MySQL result resource

Asked by deltaend in PHP and Databases, MySQL Server

Tags: ,

I'm having some issues.  I keep getting these two errors upon attempting to fill out the form:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/chocolat/public_html/index.php on line 44

Warning: Cannot modify header information - headers already sent by (output started at /home/chocolat/public_html/index.php:44) in /home/chocolat/public_html/index.php on line 59

Any ideas?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
<?php
include 'includes.php';
include 'includes/rotator_includes.php';
?>
<?php
if ( isset ($_POST['submit'])) {
    $problem = FALSE;
    
    if (strlen($_POST['email']) < 5) {
        $problem = TRUE;
        print '<b>ERROR: Incorrect email. Please enter valid email address. <br /><input type="button" value="Go Back and Fix It" onclick="history.back();"><br /></b>';
   }
  
       if (strlen($_POST['pass1']) <= 4) {
           $problem = TRUE;
     print '<b>ERROR: Your punny password is no match for the borg.  Assimilate and make it longer than 4 digits. <br /><input type="button" value="Go Back and Fix It" onclick="history.back();"><br /></b>';
    }
           if (strlen($_POST['fname']) < 2) {
           $problem = TRUE;
     print '<b>ERROR: Your first name seems too short or it wasn not filled in.<br /><input type="button" value="Go Back and Fix It" onclick="history.back();"><br /></b>';
    }
             if (strlen($_POST['lname']) < 2) {
           $problem = TRUE;
     print '<b>ERROR: Your last name seems too short or it was not filled in.<br /><input type="button" value="Go Back and Fix It" onclick="history.back();"><br /></b>';
    }
           if (strlen($_POST['phone']) < 9) {
           $problem = TRUE;
      print '<b>ERROR: Your phone number is too short or it wasn not filled in.  Please use your full area code when filling in your phone number.<br /><input type="button" value="Go Back and Fix It" onclick="history.back();"><br /></b>';
    }
    
   if (strcmp($_POST['pass1'],$_POST['pass2']) || empty($_POST['pass1']) ) {
           $problem = TRUE;
    //die ("Password does not match");
    print '<b>ERROR: You either left the password boxes empty or you did not type them the same twice.  Try again.<br /><input type="button" value="Go Back and Fix It" onclick="history.back();"><br /></b>';
    }
    
     if (strcmp($_POST['email'],$_POST['email2']) || empty($_POST['email']) ) {
           $problem = TRUE;
    //die ("Email not match");
    print '<b>ERROR: You either left the email boxes empty or your did not type them the same twice.  Try again.<br /><input type="button" value="Go Back and Fix It" onclick="history.back();"><br /></b>';
    }
$sql=mysql_query("SELECT * FROM users WHERE email={$_POST['email']}");
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
           $problem = TRUE;
    //die ('ERROR: User account already exists.');
    print '<b>ERROR: User account already exists.<br /><input type="button" value="Go Back and Fix It" onclick="history.back();"></b>';
 
    }
 
if ($problem == FALSE) { 
    $query = "INSERT INTO users
                  (first_name, last_name, email, password, phone, sponsor, leg, signup_date)
                  VALUES
                  ('{$_POST['fname']}', '{$_POST['lname']}', '{$_POST['email']}', '{$_POST['password']}', '{$_POST['phone']}', '$member_number', '$leg_pref', NOW())";  
session_register("email");
session_register("password"); 
header("location:howitworks.php");
        
                  mysql_close();
} else {
    print 'You didn\'t fill out the form correctly.  Try again.';
}
}
?>
 
Welcome to <?=$sitename?>.  My name is <?=$firstname?> <?=$lastname?> and I would like to introduce you to one of the most exciting programs of all time.
<br>
<br>
Resistance is futile.  You will assimilate.  Pre-enroll now puny human slave.<br>
<form name="signup" action="index.php" method="post">
First Name <input type="text" name="fname" maxlength="20"><br><br>
Last Name <input type="text" name="lname" maxlength="35"><br><br>
Email <input type="text" name="email" maxlength="100"><br><br>
Confirm Email <input type="text" name="email2" maxlength="100"><br><br>
Password <input type="password" name="pass1" maxlength="50"><br><br> 
Confirm Password <input type="password" name="pass2" maxlength="50"><br><br> 
Phone <input type="text" name="phone" maxlength="15"><br><br>
<input type="submit" name="submit" value="Submit">
</form>
[+][-]08.21.2008 at 05:10AM PDT, ID: 22278417

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.21.2008 at 05:17AM PDT, ID: 22278474

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 05:34AM PDT, ID: 22278645

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP and Databases, MySQL Server
Tags: PHP MySQL, Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/chocolat/public_html/index.php on line 44
Sign Up Now!
Solution Provided By: rohypnol
Participating Experts: 2
Solution Grade: B
 
 
[+][-]08.21.2008 at 05:42AM PDT, ID: 22278717

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 05:45AM PDT, ID: 22278749

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 05:47AM PDT, ID: 22278768

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 05:53AM PDT, ID: 22278826

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628