“×”符号(不是一点点x),我相信这是乘法符号,正在打破
MySQL记录.
问题是每当我尝试检索具有此符号“×”的记录时,记录将返回空白.
我顺便使用PHP和WAMP服务器.
整理是latin1_swedish_ci.但是,更改排序规则似乎并未解决问题.
mysql版本是5.6.17
这是我的函数,它从表中获取记录并将其保存到对象:
public function assign() {
$SQL = "SELECT * FROM " . $this->tb . " ORDER BY " . $this->order;
$this->tb_handle = mysqli_query($this->db_handle,$SQL);
$this->rowNumber = mysqli_num_rows($this->tb_handle);
//this creates arrays from records given even if the table is empty
//this is to prevent errors
if ($this->rowNumber === 0) {
foreach ($this->records as $record) {
$this->{$record} = array();
}
} else {
$i = 0;
while ( $db_field = mysqli_fetch_assoc($this->tb_handle) ) {
foreach ($this->records as $record) {
$this->{$record}[$i] = $db_field[$record];
$this->{$record}[$i] = htmlspecialchars($this->{$record}[$i]);
}
$i++;
}
}
}
这适用于没有“×”符号的任何东西.我不知道为什么该符号应该导致整个记录返回为空白.