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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:11:47+00:00 2026-06-17T16:11:47+00:00

I was wondering if someone could help(sorry I know this subject has been brought

  • 0

I was wondering if someone could help(sorry I know this subject has been brought up before)

I have a sign up form I want to make sure that the company and email address doesn’t exist before it is submitted.

I am grateful for any help.

Oh my table name is R_TABLE and the field is COMPANY
Oh my table name is U_TABLE and the field is EMAIL

    <?
    session_start();
    //ignore this -->$email = $_POST['email'] ;

    //error_reporting(E_ALL); 
    //ini_set("display_errors", 1); 

    //Connect to Database
    include('includes/dbconn.php');
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   <title>Sign Up Form</title>
   <link rel="shortcut icon" href="favicon.ico" />



   <link href="eps.css" rel="stylesheet" type="text/css" />
   <div class="header2">
   </div>

   //VALIDATES FIELDS

     <script language="javascript">

     function validateForm()
     {

 var x=document.forms["form1"]["email"].value;
 var atpos=x.indexOf("@");
 var dotpos=x.lastIndexOf(".");
 if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
 {
    alert("Not a valid e-mail address");
    return false;
 } 
if (document.forms["form1"]["email"].value != document.forms["form1"]  ["email2"].value) {
    alert("Email addresses do not match");
    return false;
 }


    {
    var x=document.forms["form1"]["companyName"].value;
    if (x==null || x=="")
    {
    alert("Please enter your company name.");
    return false;
    }




    }
    }

    </script>






    </head>


    <body background="images/background.gif" repeat >
    <table width="1101" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <br/> <br/>



 <p align="center" class="SignUpText">Sign Up Form</p>
     <table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="TableBorder">
     <tr>
     <td>
     <form id="form1" name="form1" method="post" action="signup.php" onSubmit="return validateForm();">
    <input name="a" type="hidden" id="a" value="signup" />
    <input name="group" type="hidden" id="group" />

    <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="MainText">
    <tr>
    <td colspan="4" class="auto-style4" style="height: 40px"><strong>
<span class="auto-style5">Personal Information</span><br/>
    </tr>

     //COMPANY NAME

    <tr>
    <td width="25%">Company Name</td>
    <td style="width: 2%">*</td>
    <td width="25%"><label>

 <input name="companyName" type="text" class="auto-style3" id="companyName" size="35" /></label></td>

     <td style="width: 2%"><a href="#" class="hintanchor" onMouseover="showhint('Please enter your registered company name.', this, event, '150px')">?</a></td>


      //EMAIL

      <td>
  <input name="email" type="text" class="auto-style3" id="email" size="40" /></td>
      <tr>
      <td>Re-enter Email Address</td>
      <td style="width: 2%">*</td>
      <td>
  <input name="email2" type="text" class="auto-style3" id="email2" size="40" />    </td>

      //SUBMIT

      <tr>
      <td colspan="4"><div align="center">
      <input type="submit" name="Submit" value="Sign Up" />
      </div>
      </td>
      </tr>
      </table>
      </form>
      </td>
      </tr>
      </table>


Here is part of the class that adds new users, the email actually is added to contactEmail field , company is added to companyname within the database which I need to check if it doesn't already have the email and company name stored

function addmember($companyname,  $licencenumber,$companyNumber,$vatNumber,$address1,$address2,$address3,$town,$county,$postcode,$firstname,$surname,$email,$phone,$training,$norepairs,$logo,$repairtype,$repairgroup,$mode)
{

    $ref = "REP";
    $licencenumber = "TEST";

    $query = "INSERT INTO r_table VALUES ";
    $query.= "(NULL,";
    $query.= "\"$ref\",";
    $query.= "\"$companyname\",";
    $query.= "\"$licencenumber\",";
    $query.= "\"$companyNumber\",";
    $query.= "\"$vatNumber\",";
    $query.= "\"$address1\",";
    $query.= "\"$address2\",";
    $query.= "\"$address3\",";
    $query.= "\"$town\",";
    $query.= "\"$county\",";
    $query.= "\"$postcode\",";
    $query.= "\"$firstname\",";
    $query.= "\"$surname\",";
    $query.= "\"$email\",";
    $query.= "\"$phone\",";
    $query.= "\"$training\",";
    $query.= "\"$norepairs\",";
    $query.= "\"$logo\",";
    $query.= "\"$repairtype\",";
    $query.= "\"$repairgroup\",";
    $query.= "NOW(),";
    $query.= "NOW(),";
    $query.= "$mode)";

    $result = mysql_query($query);

    $insertid = mysql_insert_id();
    $ref = "REP".$insertid;
    $licencenumber = "test".$insertid;

    $query = "UPDATE r_table SET ref = \"$ref\", licenseNumber=\"$licencenumber\" WHERE id = ".$insertid;

    $result = mysql_query($query);

    echo mysql_error();

    if (!$result)
        echo mysql_error();
    else
        return $ref;
  • 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-06-17T16:11:48+00:00Added an answer on June 17, 2026 at 4:11 pm

    You can do one thing like given below:

    $query = "select * from `tablename` where `fieldname` = 'value'";
    $result = mysql_query($query) or die(mysql_error());
    $num_result = mysql_num_rows($result);
    if($num_result > 0){
        //Value exist for field already
     }
    

    Here mysql_num_rows return number of rows of result of query. So using this You can check if company and email already exist or not.

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

Sidebar

Related Questions

I was wondering if someone could help me with this. I have defined my
I was wondering if someone could help with this: I have a series of
Wondering if someone could help me. I have next to no knowledge with Ajax,
Hey guys I was wondering if someone could provide a little help. I've been
I wondering if someone could help me, I have a game where the computer
I was wondering if someone could help me understand this problem. I prepared a
I was wondering if someone could help me to get this method converted to
I was wondering if someone could help I've successfully been able to import an
Im wondering if someone could help me. I have hundreds of people uploading images
I was wondering if someone could help me get pointers to solve this problem.

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.