I am attempting to use XAMPP as a simulated web server so that I can write files locally from my laptop. I do school work at my job but I don't have an Internet connection there that I can use to upload my PHP files to my school's web server. The Apache sever that comes as part of XAMPP works great for debugging .php files but I can't seem to connect to the database that I created in phpMyAdmin to debug MySQL code. Below is an example of what I am trying to do:
<?php
$user = 'root';
$password = '';
$database = 'jesse';
$con = mysql_connect('localhost', $user, $password, $database) or die( "Unable to connect." );
$sql = "insert into CLIENT (First_Name) values ('Jesse')";
mysql_query($sql) or die("Insert failed. " . mysql_error());
?>
This returns: Insert failed. No database selected