This is something that I have been really curious about. I have tried to find the answer myself but I can't exactly think what to google. So first off, I am used to doing a regular query method either like this (when escaping):
$Database->query($sql)
or if using prepared statements like this:
$Database->statement($sql, array('ss', $val1, $val2))
However when reading through the source code of a project, I found this:
$id = DB::SQL()
->select("postId")
->from("post")
->where("conversationId=:conversationId")->bind(":conversationId", $conversation["conversationId"])
->orderBy("time DESC")
->limit(1)
->exec()
->result();
Now I know this is PDO, and also a random example however since I read this I've been wondering how this is done. If someone would be kind enough to explain then I'd really appreciate it.