I'm using php prepared statement to insert into mysql database, but I'm getting:
Call to a member function bind_param() on a non-object
while trying to insert, I tried in Google and everywhere else, but I am still stuck!
$loc=$_POST['location'];
$name=$_POST['name'];
$chname=$_POST['chname'];
$address=$_POST['address'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$plan=$_POST['plan'];
$stmt = $con->prepare("INSERT INTO clinic_registration (location, clinic_name, chief_doctor,clinic_address,clinic_phone,clinic_email,clinic_plan,clinic_username,clinic_password) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssssisiss",$loc,$name,$chname,$address,$phone,$email,$plan,$name,$name);
$stmt->execute();