i am trying to use stored procedures to insert data into a sql database in php. I cant seem to get the data to enter into the database. i am new to php and stored procedures so dont know too much about them.
I have a function called addemployee() where the stored procedure is being used
function addemployee($firstname, $lastname,$email,$username,$dateofbirth,$ppsn,$password, $admin)
{
$mysqli = new mysqli('localhost', 'root', '');
$mysqli->query("CALL prc_emp_add(".$firstname.",".$lastname." , ".$email.", ".$username.", ".$dateofbirth.", ".$ppsn.", ".$password.", $admin)");
echo 'GOT HERE';
//mysqli_query($db, $query) or die(mysqli_error($db));
}
Then in another file i am calling that function and passing through variables
addemployee($_POST['firstname'],$_POST['lastname'],$_POST['email'],$_POST['username'],$_POST['dateofbirth'],$_POST['ppsn'],$_POST['password'],$admin);
when i do a var_dump on my data in the function is has gotten passed through so i know the data is there and also the echo statement is working. Really need to know am i executing the call procedure correctly or what is going wrong