xxxxxxxxxx
import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="yourusername",
password="yourpassword"
)
xxxxxxxxxx
<?php
// This is for checking if your file is linked in your page or game or whatever
echo "IT WORKS"; // My File is successfuly Linked
//Remember to create a Database in phpmyadmin or any Online Database
// the values passed in this parameters are: the host, the user, user password and the database Name
$con = mysqli_connect('localhost', 'root', 'root', 'unityaccess');
// check that connection happen
if(mysqli_connect_errno()) {
echo "1: Connection Failed"; //error code #1 = connection Failed
exit();
}
?>
xxxxxxxxxx
@Configuration
public class StaticResourceConfiguration implements WebMvcConfigurer {
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
"classpath:/META-INF/resources/", "classpath:/resources/",
"classpath:/static/", "classpath:/public/" };
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS);
}
}