0

How do I get the restoname from the db that has apostrophe on it? using the mysql or php.

The code: public function searchRestaurant($searchinfo){ $sql = "SELECT * FROM restaurants WHERE restoname = '$searchinfo' OR restocuisines = '$searchinfo'"; $result = $this->db->query($sql); $result = $result->result('array');

    return $result;
}

The error: the error

Yuki
  • 1
  • 1
  • 1
    `mysql_real_escape_string($searchinfo);` – Nana Partykar Jan 29 '16 at 14:57
  • Your question will be better received if you type-in (or cut-n-paste) your code and errors rather than using images. – John Hascall Jan 29 '16 at 15:25
  • I've tried it. but I got this error! Message: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead – Yuki Jan 29 '16 at 15:38

0 Answers0