Hello
I'm developing functions to speed select insert and avoid filling PHP code in the pages, I create a function called select_inicio and another function called select_termino and when I call these two functions, among them I insert where the results of the select will appear, but it is not working, what could be wrong?
include 'include/connection.php';
function select_inicio()
{
$query = "SELECT id, imagem, produto FROM produtos ORDER BY id ASC";
$result = mysqli_query($link, $query) or die(mysql_error());
while ($row = mysqli_fetch_array($result))
{
}
function select_termino()
{
}
}
?>
</head>
<body>
<?php select_inicio(); ?>
<?php echo $row[0]; ?>
<?php select_termino(); ?>
</body>
</html>