I am trying to create a dynamic page in wordpress that accesses a mysql database. I'm a lot confused about how to go about this. In my wp-config.php file I have the following:
define('DB_NAME', 'sustakp4_WPJ2h');
/** MySQL database username */
define('DB_USER', 'sustakp4_WPJ2h');
/** MySQL database password */
define('DB_PASSWORD', '5bndHPrEZ6df5NNep');
/** MySQL hostname */
define('DB_HOST', 'localhost');
I created a php script that looks like:
<?php
$testConnection = mysql_connect('localhost', 'sustakp4_WPJ2H', '5bndHPrEZ6df5NNep');
if (!$testConnection) {
die('Error: ' . mysql_error());
}
echo 'Database connection working!';
mysql_close($testConnection);
?>
When I try to run the scipt it says page not working.
how do I connect? When I submit a form what php file is used? What needs to go in it?