0

Hi there.

Okay heres the scenario. I have 2 tables "Logins" and "User_Details"
What I want to do is write a PHP query that whenever a new user is created, that is manually entered into "User_details" table using a form, the next thing that should happen is that it should copy the value of the first 2 attributes from user_details table which are user_id and password into "Logins" table having the same 2 attributes only.

So what is the correct PHP query code for this. I tried many things but failed. I need somebody whos good at php / mysql to help me out! :)

Thanks!

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by vista
0

I have everything setup. I just need the codes that do the copying. Assuming that the values entered are stored like this:

$values["user_id"]
$values["password"]

Attribute user_id is a primary key.

--
-- Table structure for table `logins`
--

CREATE TABLE `logins` (
  `id` varchar(50) NOT NULL default '',
  `password` varchar(50) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `user_id` varchar(50) NOT NULL default '',
  `password` varchar(50) default NULL,
  `full_name` varchar(50) default NULL,
  `nationality` varchar(50) default NULL,
  `govt_id` int(11) default NULL,
  `email` varchar(50) default NULL,
  `traffic_status` varchar(50) default NULL,
  `traffic_points` int(11) default NULL,
  PRIMARY KEY  (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Edited by vista: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.