K
K
kuznetsovtimur2014-10-02 10:11:21
PHP
kuznetsovtimur, 2014-10-02 10:11:21

Books on php describing how to work with PDO and SQLite in Russian?

Downloaded a bunch of php books already. But in all the standard set: php + mySql.
Moreover, the connection is described through mysql_lalala, or at most through mysqli
But I understand that PDO is the future. Plus, ideally, a bunch of PDO + SQLite.
Thanks in advance for specific answers.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
FanatPHP, 2014-10-02
@kuznetsovtimur

You don't need a book on SQLite if you plan to use PDO. Where there is PHP, there is always a normal database, and it makes no sense to use a toy one.
There is no need for a book on PDO as it is a very small API, literally 5 functions.
All you need to know about PDO:
1. Any variables should only get into the request through a placeholder. Therefore, all queries that involve variables must be executed through prepare / execute: first, the query is prepared through prepare (), and placeholders should be placed instead of variables, such as ? or such :name . And variables are then transferred through execute.

$pdo  = new PDO ( ... );
$stmt = $pdo->prepare("SELECT * FROM users WHERE id=?");
$stmt->execute([$_GET['id']]);
$user = $stmt->fetch();

2. There are three functions for getting data
- fetch() gets a string. analogue of mysql_fetch_array()
- fetchAll() gets an array of strings. Syntactic sugar for while ($row = mysql_fetch_array()) (this function, by the way, is the only one worth reading the manual on. It has some interesting tricks)
- fetchColumn() - syntactic sugar for $row = mysql_fetch_row(); $flag = $row[0]
3. All other subtleties and nuances are described in Russian here: www.phpfaq.ru/pdo
4. Special add-ons for PDO are not needed, but sometimes you want to fix a couple of inconvenient things. For example, using www.phpfaq.ru/pdo_wrapper, the code from paragraph 1 will be reduced to one line (and the code will work from everywhere and at once):
5. For any other questions, you can ask me

T
Twist, 2014-10-02
@bboytiwst

PDO is not the future, PDO is the present, or even the past, because now most people use ORMs (which are implemented on top of PDO)
On PDO, you can watch this series https://www.youtube.com/watch?v=QtCdk459NFg
PDO + SQLite https://www.youtube.com/watch?v=3hJC09uNTxE

A
andreyqin, 2014-10-02
@andreyqin

habrahabr.ru/post/137664
labdes.ru/php-pdo-mysql-examples
Well, nobody canceled the official documentation - php.net/manual/ru/book.pdo.php You
can also google about SQLite and find a sufficient number of articles .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question