Php execution sql file is garbled and incomplete

I want to read the sql file through php to create the database and write some initial data, so I wrote the following php code and sql
after the first floor hint, the code has run
array (size=5)
  0 => string "CREATE DATABASE IF NOT EXISTS wishwall DEFAULT CHARACTER SET "UTF8"" (length=67)
  1 => string "

USE wishwall" (length=16)
  2 => string "

CREATE TABLE IF NOT EXISTS message (
  `id` INT UNSIGNED AUTO_INCREMENT KEY COMMENT "",
  `username` VARCHAR(20) NOT NULL UNIQUE COMMENT "",
  `posttime` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT "",
  `bgcolor` VARCHAR(10) DEFAULT "-sharpFFDFFF" COMMENT "",
  `content` VARCHAR(200) NOT NULL COMMENT ""
)ENGINE=INNODB CHARSET=UTF8" (length=394)
  3 => string "

INSERT message(username,content) VALUES
("A",""" "" "),
("",""),
("",""),
("",""),
("","")" (length=489)
  4 => string "
" (length=2)

there are two questions that are wrong:

  • the comments of the created message table are garbled
  • The
  • table is created, but the initial data is not written (there is no problem with the INSERT statement, which can be successful on the mysql command line)
  • if you want to write comments in sql, will it affect reading? there can be no carriage returns or line feeds in sql?
Mar.24,2021

about garbled:
add:

under $conn = mysqli_connect ('localhost','root','');
mysqli_query($conn,'set names utf8');

is fine. Adding comments does not affect reading. The test code can be executed:

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b364ed-2b84d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b364ed-2b84d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?