- $query = $db->query('INSERT INTO `order`(`user_id`, `articul_id`, `sharpener_id`, `barcode`, `quantity`) VALUES ('.$user_id.','.$articul_id.','.$sharpener_id.','.$barcode.','.$quantity.')');
+ $db->prepare(
+ 'INSERT INTO `order` (`user_id`, `articul_id`, `sharpener_id`, `barcode`, `quantity`)' .
+ 'VALUES (?, ?, ?, ?, ?)'
+ )->execute([$user_id, $articul_id, $sharpener_id, $barcode, $quantity]);
Prior to MySQL 8.0.4, MySQL used the Henry Spencer regular expression library to support regular expression operations, rather than International Components for Unicode (ICU).
...
The Spencer library supports word-beginning and word-end boundary markers ([[:<:]] and [[:>:]] notation). ICU does not. For ICU, you can use \b to match word boundaries; double the backslash because MySQL interprets it as the escape character within strings.
\\b111,222,333\\b
#!/usr/bin/php
) и запускает интерпретатор, передавая ему путь к скрипту.$x = '-- \' --';
print $x . "\n"; // -- ' --
$y = '-- \\\' --';
print $y . "\n"; // -- \' --
To specify a literal single quote, escape it with a backslash (\). To specify a literal backslash, double it (\\).https://www.php.net/manual/en/language.types.strin...
<?php
$xml = new SimpleXmlElement(<<<XML
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog>
</yml_catalog>
XML
);
$xml->addAttribute('date', (new DateTimeImmutable())->format('Y-m-d H:i'));
print $xml->asXML();
// <?xml version="1.0" encoding="utf-8"?>
// <!DOCTYPE yml_catalog SYSTEM "shops.dtd">
// <yml_catalog date="2024-01-24 16:42">
// </yml_catalog>