Hello I have the Array to string conversion erro with this code:
index.php:
Code:
$hoArr = array(1,2,3);
foreach ($hoArr as $hid) {
$mysqli = mysqli_connect("localhost", "root", "", "zabbixtest");
if (!$mysqli) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT errors_from FROM hosts WHERE hostid = '$hid'";
$re = mysqli_query($mysqli, $sql);
while ($row = mysqli_fetch_assoc($re)) {
$query_times[] = $row['errors_from'];
}
mysqli_free_result($re);
mysqli_close($mysqli);
}
$smarty->assign('query_times',$query_times);
and index.tpl:
Code:
<p>{$query_times}</p>
I have no idea whats wrong with it..