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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:26:13+00:00 2026-05-31T17:26:13+00:00

I’m trying to write a script for users to register to a club, and

  • 0

I’m trying to write a script for users to register to a club, and it does all the validation stuff properly and works great until it gets to the part where its supposed to check for duplicates. I’m not sure what is going wrong. HELP PLEASE!!!
Thank you in Advance,

  <?php 
  mysql_connect ("sqlhost", "username", "password") or die(mysql_error());

  mysql_select_db ("databasename") or die(mysql_error());

  $errormsgdb = "";
  $errordb = "Sorry but that ";
  $error1db = "Name";
  $error2db = "email";
  $error3db = "mobile number";
  $errordbe = " is already registered";
  $pass1db = "No Matching Name";
  $pass2db = "No Matching Email";
  $pass3db = "No Matching Mobile";
  $errorcount = 0;
  $qResult = mysql_query ("SELECT * FROM table");
  $nRows = mysql_num_rows($qResult);
  for ($i=1; $i< $nRows+1; $i++){

$result = mysql_query("SELECT id,fname,lname,dob,email,mobile,agree,code,joindate FROM table WHERE fname = '$ffname");
if ($result > 0) {
$errorcount = $errorcount++;
$passdb = 0;
$errormsgdb = $error1db;
echo "<div class=\"box red\">$errordb $errormsgdb
} else {
$pass = 1;
$errormsgdb = $pass1db; 
echo "<div class=\"box green\">$errormsgdb</div><br />";
}



  //--------------- Check if DB checks returned errors ------------------------------------>
        if($errorcount <= 0){
        $dobp = $_REQUEST['day'].'/'.$_REQUEST['month'].'/'.$_REQUEST['year'];
        $dob = $_REQUEST['year'].$_REQUEST['month'].$_REQUEST['day'];
        //header('Location: thankyou.php?ffname='.$ffname.'&flname='.$flname.'&dob='.$dob.'&femail='.$femail.'&fmobile='.$fmobile.'&agree='.$agree.'&code='.$code.'&dobp='.$dobp);
        echo "<div class='box green'>Form completed! Error Count = $errorcount</div>";
        } else {
        echo "<div class='box red'>There was an Error! Error Count = $errorcount</div>";
            }
  }
     ?>
  • 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-31T17:26:15+00:00Added an answer on May 31, 2026 at 5:26 pm

    There are quite a few things that don’t make sense in your script, the multiple queries for one ! why not just query for the data and see if you get a match – instead of looping each user and checking it ?? … but I think your main problem is

    $errorcount = " ";
    

    then you do

    $errorcount = $errorcount++;
    

    this will NOT work … you created $errorcount as a string so incrementing it won’t work. You should initialise it as a number :

    $errorcount = 0;
    

    then to increment :

    $errorcount++;
    

    Example of it not working and then working here

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.