We've partnered up with to offer a space where you can talk directly to Peter from and get an exclusive discount code for a free job listing. If you are recruiting or know anyone else who is please check out the forum here.
If you have a new account but can't post, please email Niamh on [email protected] for help to verify your email address. Thanks :)

PHP stored procedure help

  • 03-12-2017 7:15pm
    Registered Users Posts: 5 ✭✭✭ BlueBallons

    Hi im new to php and trying to execute a stored procedure to insert into a database can someone please explain where i am going wrong. I will post my code below thanks!


    include_once "constants.php";

    class database {

    var $connection;

    //Function to connect
    function connect(){
    $this->connection = mysqli_connect(SERVER, USER, PASSWORD, DATABASE);
    die("Connection failed");

    return $this->connection;

    //Function to allow stored procedures to be called from different classes




    require_once 'constants.php';
    require_once 'connection.php';

    $connection = new database();

    $first_name = $_POST;
    $last_name = $_POST;
    $password = $_POST;
    $email = $_POST;
    $dob = $_POST;
    $profile_pic = $_POST;

    // Calls stored procedure

    $result = mysqli_query($connection->connect(),"CALL InsertNewMember('$first_name',''$last_name','$password','$email','$dob','$profile_pic')");[/PHP]