How to work with PHP PDO?

Hello! Read a book on PHP and SQL (by David Sklar, page 201), which was given code like this:
$db = new PDO('sqlite:/tmp/restaurant.db'); //(1)
$q = $db->exec("CREATE TABLE dishes (
 dish_id INT,
 dish_name VARCHAR(255) //(2)
 //and so on

Here are my questions:
(1) - what is this way 'sqlite:/tmp/restaurant.db'? The book mentions nothing about these files. It is a path that specifies where to write the generated database? Or what is it? How to do the same with sql (not with sqlite)?
This is the way to Baja data. But how to create it? How to make so that this way was correct?
June 8th 19 at 16:48
1 answer
June 8th 19 at 16:50
  1. sqlite is a simple database roughly speaking, a file that works with SQL queries, it does not need to connect to the database server, but you can use almost immediately
  2. Yes, it is a string with a maximum length of 255 characters, if more, t oviduct error

Hmm. Thank you very much. If you do not want to connect that then what is that way? - maxie.Mo commented on June 8th 19 at 16:53
the line cannot be written up to 255 characters, all the excess will be clipped. And to SQL to do the same, we need to create database and connect to it like so - violet_Dibbe commented on June 8th 19 at 16:56

Find more questions by tags PHP PDOPHP