MySQL Forums
Forum List  »  PHP

Re: Having trouble with mysqli_insert_id mysql stored procedure in php
Posted by: Andrew James
Date: February 02, 2017 05:39PM

The Message that I kept seeing is in php that says:

"new record has id:0"

in mysql database in mysql only, I tested it out by using this which is in mysql only not php.

set @new_id = null;
call registerusers(@new_id,'Jerry','Jones','5566','jon@gmail.com','sdfd','1');
select @new_id;

it work but when doing in php it does not work.

Here's the create table in mysql

Create table Users
(
UserID tinyint(11) NOT NULL AUTO_INCREMENT,
FirstName varchar(30) NOT NULL,
LastName varchar(30) NOT NULL,
Password varchar(30) NOT NULL,
EmailAddress varchar(30) NOT NULL,
Salt varchar(40) NOT NULL,
RoleID varchar(1) NOT NULL,
Primary Key(UserID),
foreign Key(RoleID) references Roles(RoleID)
);

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.