mysqli_query not working code example
Example: how to solve php mysqli_query function problem does not execute
<?php
$con = mysqli_connect("localhost", "root", "", "test");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "INSERT INTO files VALUES (NULL, 5, 'hello')";
echo "<pre>Debug: $query</pre>\m";
$result = mysqli_query($con, $query);
if ( false===$result ) {
printf("error: %s\n", mysqli_error($con));
}
else {
echo 'done.';
}