-1

I recieve the echo before the bind_param statment but not after it

$stmt = $this->conn->prepare("INSERT INTO restaurants(unique_id, name, type, longitude, latitude, value_for_money, cleanliness, view, atmosphere, staff created_at) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW())");

    echo "ezzat wasal";

    $stmt->bind_param("sssddiiiii", $uuid, $name, $type, (double)$longitude, (double)$latitude, (int)$value_for_money, (int)$cleanliness, (int)$view, (int)$atmosphere, (int)$staff);
    echo "ana zeh2et";
chris85
  • 23,846
  • 7
  • 34
  • 51

1 Answers1

0

You are missing a comma between staff and created_at. Also I would suggest quoting all column names in the query (because some of them are reserved words in mySQL: name, type, view):

$stmt = $this->conn->prepare("INSERT INTO `restaurants`
(`unique_id`, `name`, `type`, `longitude`, `latitude`, `value_for_money`,
 `cleanliness`, `view`, `atmosphere`, `staff`, `created_at`)
 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW())");
Jirka Hrazdil
  • 3,983
  • 1
  • 14
  • 17
  • If that slipped through, [time to turn on `mysqli` exceptions](http://stackoverflow.com/questions/14578243/turning-query-errors-to-exceptions-in-mysqli). – tadman Nov 16 '16 at 23:31