H
H
HAbRAhabp2015-11-10 18:18:59
PHP
HAbRAhabp, 2015-11-10 18:18:59

How to prefix requests?

Good afternoon, I use mysqli for my projects. But I don't understand how to include the prefix when requesting? For example:

$db->query("SELECT*FROM `example` where `one`='two'");
// а запрос на самом деле выполнялся такой:
// SELECT*FROM `pb_example` where `one`='two'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Miku Hatsune, 2015-11-10
@Hatsune-Miku

Create a class such as MyDatabaseAdapter, make it a descendant of the MySQLI class.
Override the query method by adding a prefix to the query.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question