I'm trying to display a data from DB using mysqli.
I'm not sure if I'm doing it right, my concern was secure. Am I doing it right?
<?php
include_once('user.php');
// Inialize session
session_start();
$con=mysqli_connect("localhost","root","root","dbname");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT aboutme FROM testing where id=1");
if ($result) {
if ($row = mysqli_fetch_array($result, MYSQL_ASSOC))
{
$aboutme = $row['aboutme'];
}
}
mysqli_close($con);
?>