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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:37:06+00:00 2026-06-15T20:37:06+00:00

This the the code for my website. It is designed to register new users,

  • 0

This the the code for my website. It is designed to register new users, only a logged in admin can do this. The account is created successfully, but it doesn’t seem to be returning a 1 for mysqli_num_rows. I printed the value that num_rows returning and nothing came out, not even a 0. I have worked on this for days, I am very new to coding in php so this is probably a glaring mistake, but I can’t see it. Any help would be greatly appreciated. I have search Google, but couldn’t find anything.

if($_SERVER['REQUEST_METHOD']=="POST"){
    $name = mysqli_real_escape_string($_POST['fname']);
    $email = mysqli_real_escape_string($_POST['email']);
    $user = mysqli_real_escape_string($_POST['user']);
    $pass = mysqli_real_escape_string(md5($_POST['password']));
    $authority = mysqli_real_escape_string($_POST['use']);

    $queryCheck = "SELECT `user` FROM `user` WHERE `user`='$user';";
    $resultCheck = mysqli_query($link, $queryCheck);
    $rowCheck = mysqli_num_rows($resultCheck);
    if($rowCheck != 1){
    $query = "INSERT INTO `user` (`id`, `name`, `email`,`user`,`pass`) VALUES ($authority,'$name','$email','$user','$pass');";

    //echo $query;

    $result = mysqli_query($link, $query);
    $row = mysqli_affected_rows($result);

    if($row == 1){
        echo "User Created Successfully!<br/>";
        echo '<br/><br/><br/><a href="admin.php">Return to Administration Page</a>';

    }else{
        echo "User was not created, Please try again.";
    }
    }else{
        echo 'User already exists.';
    }
}
  • 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-15T20:37:08+00:00Added an answer on June 15, 2026 at 8:37 pm

    I found that you have to use mysqli_affected_rows for an insert phrase in mysql.

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

Sidebar

Related Questions

VS 2008 I have this code snippet I found on a VB website. But
I saw this code in http://www.cise.ufl.edu/~manuel/obfuscate/obfuscate.html (http://www.cise.ufl.edu/~manuel/obfuscate/savastio) website.But this code is very very crazy.
Sorry I'm completely new to this. Ive designed a website in photoshop, and exported
Recently I have seen this code in a WebSite, and my question is the
I am using this code in my website to show Google search results for
To change the language on my website I've been using ressources and this code:
I want to protect my website against spambots with javascript. I found this code,
I want to rewrite http://website.com/?slug=product_info.php&products_id=32 to http://website.com/product_info/32 and I use this code, add_filter('rewrite_rules_array','wp_insertMyRewriteRules'); add_filter('query_vars','wp_insertMyRewriteQueryVars');
1. Problem I am adding a shoutcast radio to website (appeding this code to
This is my code. I am trying to load a website in a iframe.

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.