我试图使用mysql where子句从表中获取数据。但它不会返回任何值或错误。
这是函数
function getMsgByName($sender){
global $connection;
$sender = mysqli_real_escape_string($connection,$sender);
$query = "SELECT Message FROM chat WHERE Sender ='$sender'";
$run = mysqli_query($connection,$query);
$messages = array();
while($message = mysqli_fetch_assoc($run)){
$messages[] = array('message'=>$message['Message']);
}
return $messages;
}