MySQL在不同的键下用两个相同的数据返回两行。MySQL在不同的键下用相同的数据返回两行
Array
(
[0] => 1
[id] => 1
[1] => Good
[name] => Good
[2] => 1.jpg
[path] => 1.jpg
)
我在谈论的事情是[0]和[ID]具有相同的数据,并直接从查询这是为什么,是有办法解决它只是返回字符串键,它返回。
我的查询函数。
<?php
class Database
{
private static $connection = null;
public function Connect()
{
self::$connection = mysqli_connect("127.0.0.1", "root", "", "image");
if (mysqli_connect_errno()) { die("Failed to connect to MySQL"); }
}
public function custome($query)
{
$result = mysqli_query(self::$connection, $query);
while ($item = mysqli_fetch_array($result)) { $resultArray[] = $item; } return $resultArray[0];
}
}
?>
你能后的查询? – javajavajava 2015-03-24 21:08:33
@BarbiePylon我加了。 – 2015-03-24 21:09:57
这是不是与MySQL的问题这是你正在使用的语言和你正在克服的问题,例如php – 2015-03-24 21:10:32