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

  • Home
  • SEARCH
  • 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 6873681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:05:57+00:00 2026-05-27T04:05:57+00:00

The INSERT into staffprofiles mysql query (near the bottom of the code) is getting

  • 0

The INSERT into staffprofiles mysql query (near the bottom of the code) is getting the “or die” statement triggered. Can anyone see why? The first one into staffusers is fine. Am I breaking a rule by having 2 insert commands or something? If so, is there another way to code what I am trying to do? Thank you in advance for any help.

Also, I will be address SQL injection and other items shortly. I just want to get this figured out first. Thanks.

<html>
<head>
  <title>XXXXXXX</title>
  <link rel="stylesheet" type="text/css" href="style.css" />
</head>

      <body>
         <div id="back">
         </div>


        <div id="wrapper">

                <div id="header">
                 <div id="logout">
                <?php
              include 'header.php';
                ?>


                 </div>
                  <span><b>XXXXXXX</b>XXXXXX</span>
                </div>

                <?php
                include 'menu.php';

if (isset ($_POST['submit']))

{
}

else

{
echo "not set";
}


$user=$_POST['username'];
$pass1=$_POST['pass1'];
$pass2=$_POST['pass2'];
$email=$_POST['email'];
$user=strip_tags($user);
$email=strip_tags($email);
$pass1=strip_tags($pass1);

$isemail = "SELECT * from staffusers where email ='$email'";
$isemail2 = mysql_query($isemail) or die ("could not query email in table");
$isemail3 = mysql_fetch_array($isemail2);

if ($isemail3)
{
echo "That email address is already registered.<br>";
echo "<a href='forgotpassword.php'>Forgot passsword.</a><br>";
echo "<a href='staffregisterform.php'>Go back to register under a different email address.</a>";
exit;
}

if ($email == "" || $user == "" || $pass1 == ""  || $pass2 == "")
{
echo "please complete all fields before submitting<br>";
echo "<a href='staffregisterform.php'>Go Back</a>";
exit;
}

if (strlen($pass1)<6)
{
echo "Your password must be at least 6 characters in length.<br>";
echo "<a href='staffregisterform.php'>Go Back</a>";
exit;
}

if ($pass1 == $pass2)
{
$isplayer = "SELECT * from staffusers where username ='$user'";
$isplayer2 = mysql_query($isplayer) or die ("could not query user in table");
$isplayer3 = mysql_fetch_array($isplayer2);

if ($isplayer3)
{
echo "The username ''$user'' is already taken. Please try another username.<br>";
echo "<a href='staffregisterform.php'>Go Back</a>";
exit;
}

if (strlen($user)>16 || strlen($user)<2)
{
echo "Your username must be be at 2 two characters and at most, 16 characters.<br>";
echo "<a href='staffregisterform.php'>Go Back</a>";
exit;
}
}

else
{
echo "The passwords do not match.<br>";
echo "<a href='staffregisterform.php'>Go Back</a>";
exit;
}

$pass1=MD5($pass1);

$register = "INSERT INTO staffusers (username, password, email) VALUES ('$user', '$pass1', '$email')";
mysql_query($register) or die ("staffusers.");

$profile = "INSERT INTO staffprofiles (username, email) VALUES ('$user', '$email')";
mysql_query($profile) or die ("staffprofiles.");

echo "Thank you for registering, $user.<br>";
echo "<a href='index.php'>Login</a>";

?>
  • 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-27T04:05:58+00:00Added an answer on May 27, 2026 at 4:05 am

    If you have valid fieldnames and table names then try;

    $profile = mysql_query("INSERT INTO staffprofiles (username, email) VALUES ('$user', '$email')");
    
    // use some value directly to check as:
    $user = "Tester";
    $email= "something@test.com";
    $profile = mysql_query("INSERT INTO staffprofiles (username, email) VALUES ('$user', '$email')");
    
    //if this value gets inserted then you have problem in $user variables value
    

    Hope it helps

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

Sidebar

Related Questions

INSERT INTO expense (date,desc,price,out,method) VALUES ('$time','$desc','$price','$out','$method'); What is wrong in the MySQL statement above?
How can insert a array into my MySQL database? I have managed to insert
Code: mysql_query(INSERT INTO Account(User, Pw, email) VALUES('mysql_real_escape_string($_POST[user])', '$pw','mysql_real_escape_string($_POST[email]) ) ) or die(mysql_error()); Error: You
I can't insert data into sqlite table. Here is my code: import sqlite3 connection
INSERT INTO [Tasks] ([LoginName] ,[Type] ,[Filter] ,[Dictionary] ,[Description]) Select N'Anonymous',4,'SomeTable.targetcode in (select Code from
What do you insert into Python source code to have it break into pdb
SQL statement: INSERT INTO order (`ORDER_ID`,`SALE_CODE`,`CREATED_AT`,`UPDATED_AT`) VALUES ('2646253286','HPHS20','2009-07-11 12:07:40','2009-07-11 12:07:40') Error: You have an
mysql_query(insert into support values('null','$status','$sbj','$message','$userid','$user','','','$date',''), $dbc) or die('Could not connect: ' . mysql_error()); $index =
here's my code: insert into archive from temp where temp.field6>archive.field6 i would like to
I have a standard insert into / select statement that is formatted similar to

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.