我在做什么错在这里?MySQL的结果的一个数组...
我试图返回一个JSON对象,我似乎无法让过去的阵列......我已经建立了数百个规则排列,并恢复他们作为一个JSON对象,但我有一个很难包装我头部围绕这一个。
$rows = array();
$post_array = array();
$i = 0;
$result = mysql_query(" SELECT * FROM forum_posts WHERE permalink = '$permalink' AND LOWER(raw_text) LIKE '%$str%' ");
while($row = mysql_fetch_assoc($result))
{
$post_array[$i] = $rows[ "id" => htmlentities($row["id"]),
"post_content" => htmlentities($row["content"]),
"author" => $row["author"],
"last_updated" => $row["last_updated"],
"author_id" => $row["author_id"],
"editing_author" => $row["editing_author"],
"date" => $outputQuoteDate ];
$i++;
}
这和M_M的一样好用 –