What would be the correct way to connect to database ? I don't get errors but maybe my connect isn't used correctly I'm using mysqli Here is my code
<?php
require_once("configur.php");
$mysqli = new mysqli(localhost, root, password, user);
$query_image = 'INSERT INTO fun_table (images1, images2, images3, images4)
values( "' . $_FILES['file1']['name'] . '",
"' . $_FILES['file2']['name'] . '",
"' . $_FILES['file3']['name'] . '",
"' . $_FILES['file4']['name'] . '"
)';
if ($mysqli->query($query_image) === TRUE) {
echo "<script language='javascript'>\n";
echo "alert('Upload successful!')";
echo "</script>\n";
} else {
echo "Error updating record: " . $conn->error;
}
$mysqli->close();
?>