";
$cp = 'utf8'; $mysqli->query("set names '".$cp."';");
if($result = $mysqli->query($sql)){
$field_cnt = $result->field_count;
while ($finfo = $result->fetch_field()) { //vypis hlavicku
print("| ". $finfo->name." | ");
}
$nr = $result->num_rows;
print "
";
while($row = $result->fetch_array(MYSQLI_BOTH)){
print "";
for($i=0;$i<$field_cnt;$i++)print "| $row[$i] | "; //telo
$nr--;
if($nr)print "
";
}
}
else die("nefunguje $sql");
print "";
$sql="SELECT COUNT(*) FROM student";
$cp = 'utf8';
$mysqli->query("set names '".$cp."';");
if($result = $mysqli->query($sql)){
$num_results = mysqli_num_rows($result);
while($row = $result->fetch_array(MYSQLI_BOTH))
{
print " text = $row[0], ďalší text $row[1], Ďalší text $row[2]
";
}
}
else die("Nepodarilo sa $sql");
print "";
return;
?>