0

I have a form from which the user can edit their profile information. It's functional, I just need to do the part where info stored on the user will be displayed on the form, so it's not necessary to input everything again.

This is my code:

    //connect to DB
    include ('../config/dbconnect.php');

    // prepare and bind
    $stmt = $conn->prepare("SELECT person.fname, person.lname, member.email, member.title, member.description, member.image FROM person INNER JOIN member ON person.personid = member.personid WHERE personid=?");

    /* execute statement */
    $stmt->execute([$pid]);

    /* bind result variables */
    $stmt->bind_result($fname, $lname, $email, $title, $description, $target_file);
    $stmt->fetch();
    /* close statement */
    $stmt->close();

    //Close Connection
    mysqli_close($conn);

However I keep getting the error:

Fatal error: Uncaught Error: Call to a member function execute() on boolean in C:\xampp\htdocs\ResearchWebsite\forms\editMemberInfo.php:27 Stack trace: #0 {main} thrown in C:\xampp\htdocs\ResearchWebsite\forms\editMemberInfo.php on line 27

line 27 is execute line

Ema Black
  • 63
  • 1
  • 12

0 Answers0