-2
<?php
define('HOST', 'localhost');
define('USER', 'root');
define('PASS', '');
define('DBNAME', 'soufood');
try {
$conn = new PDO('mysql:host='.HOST.';dbname='.DBNAME.';',USER, PASS);
}catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}
function ExibirCarrinho(){
$exibirCarrinho = "SELECT * FROM carrinho";
$exibirCarrinho = $conn->prepare($exibirCarrinho);
$exibirCarrinho->execute();
while ($row = $exibirCarrinho->fetch(PDO::FETCH_ASSOC)) {
}
}
?>
Pass the connection as parameter.
– Augusto Vasques
Show! Thank you friend.
– Kauan Douglas