Hej.
Hvor er fejlen i følgende UPDATE? Jeg får følgende fejl:
"Fatal error: Call to a member function bind_param() on a non-object"
- <?php
- if (!isset($_POST['update'])){
- }
- else
- {
- $email = $_POST['email'];
- $address = $_POST['address'];
- $address2 = $_POST['address2'];
- $zipcode = $_POST['zip_code'];
- $city = $_POST['zip_code'];
- $phone = $_POST['phone'];
- $website = $_POST['website'];
-
- $stmt = $db->prepare("UPDATE `userinfo`, `user` SET user.email = '$email', userinfo.address='$address',
- userinfo.address2='$address2', userinfo.zip_code = '$zipcode', userinfo.city='$city', userinfo.phone='$phone', userinfo.website='$website'
- WHERE userinfo.user_id=('".$user_id."') AND user.user_id=('".$user_id."')");
- $stmt->bind_param('sssisss', $email, $address, $address2, $zipcode, $city, $phone, $website);
- $stmt->execute();
- echo "Din profil er opdateret";
- $stmt->close();
- }
- ?>
$user_id hentes ind ved session