나는이 오류를 얻고있다 주어진 기대 여기 경고 : 코드 "searchcar.php"에서 "배열에서 주어진 매개 변수 (1) mysqli_result 수() 기대 mysqli_fetch_assoc 경고"mysqli_fetch_assoc는()는 매개 변수 1 mysqli_result 수, 배열
$modelmake = $_POST['model_make'];
$result = $db->select('car_information','*', 'Model_Make LIKE \'%$modelmake%\'');
while($row = mysqli_fetch_assoc($result))
{
echo 'Model'.$row['model_make'];
}
는 "database.php"선택 기능에서
public function select(
$table,
$fields = '*',
$where = '1=1',
$order = '',
$limit = '',
$desc = false,
$limitBegin = 0,
$groupby = null,
$monitoring = false
) //monitoring is set to true to view the actual query
{
// $query ='SELECT ' . $fields . ' FROM ' . $table ;
$query = 'SELECT ' . $fields . ' FROM ' . $table . ' WHERE ' . $where;
if (!empty($groupby)) {
$query .= ' GROUP BY ' . $groupby;
}
if (!empty($order))
{
$query .= ' ORDER BY ' . $order;
if ($desc)
{
$query .= ' DESC';
}
}
if (!empty($limit))
{
$query .= ' LIMIT ' . $limitBegin . ', ' . $limit;
}
$result = $this->_sendQuery($query);
$resultArray = array();
while ($row = mysqli_fetch_assoc($result))
{
$resultArray[] = $row;
}
if ($monitoring)
{
// If monitoring is activated, echo the query
echo $query;
}
return $resultArray;
}
나는이 줄을 사용하려면 "동안 ($ 행 = mysqli_fetch_assoc ($ 결과))" 제발 조언을 코드입니다!
무엇이 var_dump ($ result)를 출력합니까? –
'select()'콜백은 이미 mysqli_fetch_assoc을 사용하여 배열을 수집합니다. 나중에 다시 호출해야한다고 생각하는 이유는 무엇입니까? – mario