Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7699391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:28:00+00:00 2026-05-31T22:28:00+00:00

EDIT SO I figured out a fix. I replaced the while statement with an

  • 0

EDIT


SO I figured out a fix. I replaced the while statement with an if and it worked perfectly. Thanks to everyone who helped out!


I was making a sign up page when this error came up ( I’m still kind of new to programming and php so this might explain what the error is and I just don’t know)

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /Users/Jacob/Sites/website/postregister.php on line 22

Here’s my code:

<!-- start sign up form -->
            <?php
            include("config.php");
            $firstname = mysql_real_escape_string($_REQUEST['firstname']);
            $lastname = mysql_real_escape_string($_REQUEST['lastname']);
            $email = mysql_real_escape_string($_REQUEST['email']);
            $birthyear = mysql_real_escape_string($_REQUEST['birthyear']);
            $city = mysql_real_escape_string($_REQUEST['city']);
            $address = mysql_real_escape_string($_REQUEST['address']);
            $state = mysql_real_escape_string($_REQUEST['state']);
            $phone = mysql_real_escape_string($_REQUEST['phone']);
            $password = mysql_real_escape_string($_REQUEST['password']);
            $zipcode= mysql_real_escape_string($_REQUEST['zipcode']);
            $active = 0;
            $hash = md5( rand(0,1000) ); // Generate random 32 character hash and assign it to a local variable.
            $sql= mysql_query("INSERT INTO member (firstname, lastname, email, phone, city, state, address, zipcode, password, hash, active)
            VALUES

            ('$firstname','$lastname','$email','$phone', '$city', '$state','$address', '$zipcode', '$password', '$hash', '$active')")or die(mysql_error());
                                    while($row == mysql_fetch_array($sql)){
                                    $to = $email; //Send email to our user
                                    $subject = 'Signup | Verification'; //// Give the email a subject 
                                    $message = '

                                    Thanks for signing up!<br/>
                                    Your account has been created, you can login with the following credentials after you have activated your account by pressing the url below.<br/>

                                    ------------------------------------------------------------------------------<br/>
                                    Email: '.$email.'<br/>
                                    Password: '.$password.'<br/>
                                    ------------------------------------------------------------------------------

                                    <a href="http://localhost/~jacob/pages/verify.php?email='.$email.'&hash='.$hash.'">Please Click Here to Activate Your Account</a>

                                    '; // Our message above including the link

                                    $headers  = "From: customersupport@example.com\r\n"; 
                                    $headers .= "Content-type: text/html\r\n";
                                    mail($to, $subject, $message, $headers); // Send the email
                                }

            ?>
            <form action="postregister.php" method="post">
                <label for="firstname">First Name:</label><br/>
                <input type="text" name="firstname" value="" size='90' style='height:20px;' /><br/><br/>
                <label for="lastname">Last Name:</label><br/>
                <input type="text" name="lastname" value="" size='90' style='height:20px;'/><br/><br/>
                <label for="email">Email:</label><br/>
                <input type="text" name="email" value="" size='90' style='height:20px;'/><br/><br/>
                <label for="birthyear">Birthyear:</label><br/>
                <input type="text" name="birthyear" value="" size='90' style='height:20px;'/><br/><br/>
                <label for="city">City:</label><br/>
                <input type="text" name="city" value="" size='90' style='height:20px;'/><br/><br/>
                <label for="phone">Phone:</label><br/>
                <input type="text" name="phone" value="" size='90' style='height:20px;'/><br/><br/>
                <label for="address">Address:</label><br/>
                <input type="text" name="address" value="" size='90' style='height:20px;'/><br/><br/>
                <label for="zipcode">Zipcode:</label><br/>
                <input type="text" name="zipcode" value="" size='90' style='height:20px;'/><br/><br/>
                <label for="State">State:</label><br/>
                <input type="text" name="state" value="" size='90' style='height:20px;'/><br/><br/>
                <label for="password">Password:</label><br/>
                <input type="password" name="password" value="" size='90' style='height:20px;'/><br/><br/>


                <input type="submit" class="submit_button" value="Sign up" />
            </form>

Any help would be GREATLY appreciated. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:28:01+00:00Added an answer on May 31, 2026 at 10:28 pm

    It looks like your query is returning false. I would imagine there’s an error with your database connection. Try printing your query and running it manually on your database to confirm it’s running properly. You can also just try a simple:

     $result = mysql_query("SELECT * FROM member LIMIT 10");
     $row = mysql_fetch_array($result);
     print_r($row);
    

    And see what happens. I imagine this will error out too. Check your include("config.php"); and be sure your DB link is set up and working properly. To confirm your $sql isn’t getting a valid result you can try dumping it out and seeing what type it is using either print_r or var_dump. Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: I think I've figured out how to do the binary data part. Double
EDIT AGAIN ... I'm just a dummy and figured it out! EDIT: So, it
EDIT: Figured out the problem. Also if you found this through google or another
I asked this question previously and thought I had it figured out but it
I am new to OLAP, and figured out how to make a cube and
Until recently I've been using mysql_real_escape_string() to fix most of my variables before making
EDIT : I swapped out my structural implementation, but my problem still remains the
[EDIT 2] It's probably because the surface is being freed while it's still in
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.