0
Example: SELECTS Has three names, I want to print these 3 names on another page.
page1.php
<?php
session_start();
include_once("config.php");
?>
<?php
$sql = $db->query("SELECT nome FROM banco_de_dados");//SELECT TEM 3 nomes (vitor,matheus,carol)
?>
<?php
while($dados = $sql->fetch_array()){
$nome = $dados['nome'];
$_SESSION['nome'] = $nome;
};
?>
page2.php
<?php
session_start();
$nome = $_SESSION['nome'];
echo $nome;
?>
print on the page:
vitor
matheus
carol
https://i.stack.Imgur.com/evLUR.png
– user60252
https://pt.meta.stackoverflow.com/questions/1078/como-e-por-que-aceitar-uma-resposta/1079#1079
– user60252