Welcome Guest, Not a member yet? Register   Sign In
[Solved] When Insert New User Get 2 preg_match() errors
#4

[eluser]riwakawd[/eluser]
[quote author="Tim Brownlaw" date="1398753608"]Hi,

When you perform an insert, using $this->db->insert_id() will return the value of the newly created primary key.
Which is normally an auto incrementing integer...

So if you use an id as your primary key as your members id, that should work out for you.

cheers
Tim[/quote]

I have on my sql both user and id as int. but trying now to get the user id have the same as id. Are you saying to put AUTO_INCREMENT every thing else is working but not the user_id just trying to get that the same when user registers. If you know what I mean.


Code:
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `ip` varchar(45) NOT NULL,
  `firstname` varchar(255) NOT NULL,
  `lastname` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `country` varchar(255) NOT NULL,
  `joined_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;


Messages In This Thread
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-28-2014, 06:02 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-28-2014, 08:02 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-28-2014, 11:40 PM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-28-2014, 11:52 PM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-29-2014, 12:09 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-29-2014, 12:16 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-29-2014, 01:27 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-29-2014, 07:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB