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 6179547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:41:11+00:00 2026-05-24T00:41:11+00:00

Okay, believe me I have been sitting here for a long time staring at

  • 0

Okay, believe me I have been sitting here for a long time staring at this. I can’t for the life of me figure out what is wrong.

I get no error message even with them turned on. When I take away the die statements it displays the text at the end so it’s definitely an SQL error. Gah I hate SQL!

<?php

include('functions.php');

if(!$_POST['regtype'] || !$_POST['regemail'] || !$_POST['regpass'] || !$_POST['regpass2']) {
"You didn't fill out a required field.";
exit();
}
if($_POST['regpass'] != $_POST['regpass2']) {
"Your passwords didn't match.";
exit();
}


$regtype = protect($_POST['regtype']);
$regemail = protect($_POST['regemail']);
$regpass = protect($_POST['regpass']);
$secregpass = sha1($regpass);
$regdate = date("Y/m/d");


// seems to be right below here

$checksql = "SELECT * FROM profile WHERE email = '$regemail'";
$checkquery = mysql_query($checksql,$connect) or die(mysql_error());
$checknumrows = mysql_num_rows($checkquery) or die(mysql_error());
if($checknumrows > 0) {
    "A user with that email already exists!";
    exit();
} else {

    $inssql = "INSERT INTO profile (email, pass, type, regdate) VALUES ('$regemail', '$secregpass', '$regtype','$regdate')";
    $insquery = mysql_query($inssql, $connect) or die(mysql_error());


    //these are just some of my notes       
    //need to make confirmation mail script later - or use donation verification as everything. def need to set up mail server


    $_SESSION['email'] = $regemail;

    echo "You have successfully registered.
            <br /><br />
            You're almost done! Please pick the charity you would like to donate to, and how much you would like to donate (minimum of $25).
            <br /><br />
            If you can't decide, you can donate to our general fund, which is equitably distributed to each charity (and is not handled by us!).
            <br /><br />
            <form action='donate.php' method='get'>
            Charity:
            <br /><br />
            <select>
            <option name='charity' value='1'>Charity 1</option>
            <option name='charity' value='2'>Charity 2</option>
            <option name='charity' value='3'>Charity 3</option>
            </select>
            <br /><br />
            USD: $<input type='text' name='amount' />
            ";
}


?>

By the way, here’s the ‘protect’ function:

function protect($string){
$string = trim(strip_tags(addslashes($string)));
return $string;

}

  • 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-24T00:41:12+00:00Added an answer on May 24, 2026 at 12:41 am

    brad, this was probably the problem;

    $checknumrows = mysql_num_rows($checkquery) or die(mysql_error());

    if profile doesn’t contain the given email, mysql_num_rows($checkquery) will be 0 so it executes die(mysql_error()) but there’s no error so the die() doesn’t print anything. In short, get rid of or die(mysql_error())

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

Sidebar

Related Questions

Okay, this has been absolutely infuriating to debug, I have finally figured out what
Okay, I believe that I can simplify this line of code except I can't
I can't believe I've stared at the following code as long as I have:
Okay, next PHPExcel question. I have an HTML form that users fill out and
Okay this question is very simple: I have a facebook page, and a website.
Okay, I have GOT to be missing something totally rudimentary here. I have an
Okay so I have been trying to style my users Gravatar image. The problem
Okay, so here's the context. I've been up for almost a day straight now
Okay guys I have a database I have been working on for days now.
So i have been stuck trying to learn this Scheme language that i heard

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.