I have a Mysql database and I have written the PHP script to be able to link into it from the PHP but I think I missed something. I cannot connect and the only documentation I can find is to save my php files to my web server. I am a little confused about what that means. I have Apache running is there somewhere in there that I am supposed to save my php files to? Thanks!
Ok I have that.. here is my php code now. my problem is that it is not connecting and i think it is where the files are saved. What I have been reading is that I have to save the file to the web server. Is that my apache server and if so how do I accomplish that? <?php $link = mysqli_connect('localhost', 'root', 'PiS1009Je'); if (!$link) { $output = 'Unable to connect to the database server.'; include 'output.html.php'; exit(); } if (!mysqli_set_charset($link, 'utf8')) { $output = 'Unable to set database connection encoding.'; include 'output.html.php'; exit(); } if (!mysqli_select_db($link, 'hoist')) { $output = 'Unable to locate the hoist database.'; include 'output.html.php'; exit(); } $output = 'Database connection established.'; include 'output.html.php'; ?>
Do you want to run it on your own computer ? without uploading to the server ? Then you have to download WAMP (Windows, Apache, Mysql, PHP) or LAMP (Linux, Apache, Mysql, PHP) server to install. Tip : if your using windows you can download "easyphp" (just google it) and run that WAMP on your computer.