if I write a query like this :
$conn = new mysqli($db_host, $db_username, $db_password, $db_database);
$conn -> query ("
DROP TABLE IF EXISTS for_search;
CREATE TABLE IF NOT EXISTS for_search
(
id INT,
for_search TEXT
);
");
$conn -> close();
it doesn't work but if i rewrite that like this:
$conn = new mysqli($db_host, $db_username, $db_password, $db_database);
$conn -> query ("
DROP TABLE IF EXISTS for_search;
");
$conn -> query ("
CREATE TABLE IF NOT EXISTS for_search
(
id INT,
for_search TEXT
);
");
$conn -> close();
it will work!
i want to know why i can't write multiple line queries in mysqli?
No comments:
Post a Comment