running my query below works fine when running in phpmyadmin
SELECT * FROM `outbox_pending` ORDER BY `id` ASC LIMIT 25
It brings back
The offer Butlers Bingo - Deposit £10 Play 60has been completed by from the source .
However, using this in my php code it brings back everything else, but shows NULL instead of this text.
I've worked out it's the pound symbol causing the issue. So, I went and changed the Collation to utf8_general_mysql500_ci and it's still not showing (I've also tried some others too).
Any ideas?
PHP Code
function viewPendingMsgs() {
// views all messages from database
include_once('db.php');
$sql = "SELECT * FROM `outbox_pending` ORDER BY `id` ASC LIMIT 25";
$result = $conn->query($sql);
//echo $sql
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$rows[] = $row;
}
print json_encode($rows);
} else {
//echo $sql;
echo json_encode(array('status'=>'fail'));
}
$conn->close();
}
Output
[{"id":"95","to":"0755XXXXXXX","msg":null,"ip":"107.66.31.214","datetime":"September 19, 2016, 6:14 am"}]