How can I better optimize the connection and listing script for MySQL
? For I check in my research several ways to do this, but I do not know if this is a correct practice of both database connection and to list information of MySQL
.
connection.php
<?php
$con = mysqli_connect("localhost", "root", "", "guaraparivirtual");
?>
index.php
<?php include ("conexao.php"); ?>
<?php
$seleciona=mysqli_query($con,"select * from noticias");
while($campo=mysqli_fetch_array($seleciona)){
?>
<?php echo $campo["Titulo"]."</br>"; ?>
<?php
}
?>