How to change the MySQL syntax to make it work in PHP?

I made a SQL query, I checked it in phpMyAdmin and it works. But in the php script gives an error.
Also checked in the service PiliApp, there is also a syntax error. I can not understand in what business, help to understand.

Here is the query itself, the cloning and update existing entries by creating a temporary table:

CREATE TEMPORARY TABLE foo AS SELECT * FROM texts WHERE id = 465;
UPDATE foo SET id = 837, html_text = "text", text_lang = "English";
INSERT INTO texts SELECT * FROM foo;
DROP TABLE foo;
March 19th 20 at 08:59
2 answers
March 19th 20 at 09:01
Solution
$mysqli->query("CREATE TEMPORARY TABLE foo AS SELECT * FROM texts WHERE id = 465");
$mysqli->query("UPDATE foo SET id = 837, html_text = 'text', text_lang = 'russian'");
$mysqli->query("INSERT INTO texts SELECT * FROM foo");
$mysqli->query("DROP TABLE foo");
March 19th 20 at 09:03
MySQL supports several SQL sentences in the text of one query.
Multiple queries

Find more questions by tags MySQLPHP