<?php
$firstname = $_POST{'firstname'};
$username = $_POST{'username'};
$emailaddress = $_POST{'emailaddress'};
$password = $_POST{'password'};
$contact = $_POST{'contact'};

//Database connection
$conn =new mysqli('localhost','root','','registration');
if ($conn->connect_error) {
    die('connection failed : '.$conn->connect_error)
}else{
    $stmt = $conn->prepare("insert into users(firstname, username, emailaddress, password, contact)
        vlaues (?, ?, ?, ?, ?)")
    $stmt-> bind param("ssssi",$firstname, $username, $emailaddress, $password, $contact)
    $stmt->execute();
    echo "Submitted Succesfully...";
    $stmt->close();
    $stmt->close();
}

?>

Benjamin_17 commented: Not sure if it a copy and paste error but line 15 should be bind_param not bind param. +0

You don't have a semi-colon at the end of lines 11, 14, and 15.

However, to fully diagnose this, please post the full PHP file as well as the full error message. The error mesage should specify what line the error is on.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.