Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.

Custom methods

ratajs edited this page Dec 19, 2017 · 6 revisions

You can also define your own methods:

$obj->selectUser = "SELECT * FROM users WHERE name LIKE '%0' AND password LIKE '%1'";

And then call it:

$obj->selectUser($_POST['name'], hash("sha256", $_POST['password']));

Or with text variables:

$obj->selectUser = "SELECT * FROM users WHERE name LIKE '%name' AND password LIKE '%pass'";

Then, callit as an array:

$obj->selectUser(['name' => $_POST['name'], 'pass' => hash("sha256", $_POST['password'])]);

Clone this wiki locally