文本在小區i在使用JSON estraction文件的問題:空白結果與 - 在PHP和JSON
如果在數據庫中,我有一個字段具有 - 內部結果的JSON是空
這是代碼
<?php
$host = "****";
$user = "****";
$password = "*****";
$db = "****";
$table=$_GET['table'];
//open connection to mysql db
$connection = mysqli_connect($host,$user,$password,$db) or die("Error " .
mysqli_error($connection));
//fetch table rows from mysql db
$sql = "select * from ".$table.";";
$result = mysqli_query($connection, $sql) or die("Error in Selecting " .
mysqli_error($connection));
//create an array
$emparray = array();
while($row =mysqli_fetch_assoc($result))
{
$emparray[] = $row;
}
echo json_encode($emparray);
//close the db connection
mysqli_close($connection);
?>
感謝 莫羅 PS的 - 是行
例如在細胞內: 敵人採取-1的攻擊檢定,並保存對...周圍表
符號不是有用:(
我所知道的是弱黑客但現在是私人:d
你意識到你正在嘗試做的事情是危險的,並且有一個巨大的sql注入漏洞。 –
你有$ _GET來獲取表...請改變 - 黑客會愛你的網站.. – ThisGuyHasTwoThumbs
什麼'mysqli_error($連接)'和PHP的錯誤報告把你丟回來? http://php.net/manual/en/function.error-reporting.php你留下了重要的細節。 –