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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:13:14+00:00 2026-05-17T02:13:14+00:00

I have two tables users registered_members I want to confirm values from user table

  • 0

I have two tables

  1. users
  2. registered_members

I want to confirm values from user table and then insert it in registered_members table
but the problem is .. values selected good from users table but inserted in registered_members with blank values
Why??

<?
include('conf.php');

// Passkey that got from link
$passkey=$_GET['passkey'];

$tbl_name1="users";

// Retrieve data from table where row that match this passkey
$sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='$passkey'";
$result1=mysql_query($sql1) or die ("error1") ;

// If successfully queried
if($result1){

// Count how many row has this passkey
$count=mysql_num_rows($result1);

// if found this passkey in our database, retrieve data from table "users"
if($count==1){

$rows=mysql_fetch_array($result1);
$username=$_POST['uname'];
$fname=$_POST['fname'];
$password=$_POST['password'];
$email=$_POST['email'];
$age=$_POST['age'];
$gender=$_POST['gender'];

$tbl_name2="registered_members";

// Insert data that retrieves from "users" into table "registered_members"
$sql2=("INSERT INTO $tbl_name2 (uname,fname,password,email,age,gender)VALUES('$username','$fname','$password','$email','$age','$gender')");
$result2=mysql_query($sql2) or die ("error insert");
}

// if not found passkey, display message "Wrong Confirmation code"
else {
echo "Wrong Confirmation code";
}

// if successfully moved data from table"users" to table "registered_members" displays message "Your account has been activated" and don't forget to delete confirmation code from table "users"
if($result2){

echo "Your account has been activated";

// Delete information of this user from table "temp_members_db" that has this passkey
$sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '$passkey'";
$result3=mysql_query($sql3);

}

}
?>
  • 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-17T02:13:15+00:00Added an answer on May 17, 2026 at 2:13 am

    Because you are using $_POST instead of #rows

    Change

    $rows=mysql_fetch_array($result1); 
    $username=$_POST['uname']; 
    $fname=$_POST['fname']; 
    $password=$_POST['password']; 
    $email=$_POST['email']; 
    $age=$_POST['age']; 
    $gender=$_POST['gender'];  
    

    with

    $rows=mysql_fetch_array($result1); 
    $username=$rows['uname']; 
    $fname=$rows['fname']; 
    $password=$rows['password']; 
    $email=$rows['email']; 
    $age=$rows['age']; 
    $gender=$rows['gender'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables. One is a 'Users' table. Each row (user) in the
I have two tables.One table contain the values +---------+ Users ---------+ A B C
I have a simple database with two tables. Users and Configurations. A user has
Have two tables with a linking table between them. USERS +-------+---------+ | userID| Username|
Let's say you have two tables, Users and UserRoles. Here's how the two tables
I have a table, users, in an Oracle 9.2.0.6 database. Two of the fields
I have two tables containing Tasks and Notes, and want to retrieve a list
I have two tables Users (name, email, password, instance_id, etc...) example: james bond, james@abc.com,
I have two tables i.e. Users uid | firstname 1 | John 2 |
I have two tables that are joined together. A has many B Normally you

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.