I'm very new php. Have been using mysql for many years but only on a pc (ie not networked).
I have set up a pc on my lan as a server and can access it from the local network.
I'm having trouble connecting to the mysql db installed on the server pc.
The following simple code echos 'start' as in first php line, nothing is output after that. Not even 'Connection failed:'
<!DOCTYPE html>
<html>
<body>
<h1>test php</h1>
<?php
echo "start";
$servername = "localhost";
$username = "username";
$password = "password";
// Create connection
$conn = mysql_connect($servername, $username, $password);
echo "after";
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";?>
</body>
</html>
The server is running Kubuntu 14.04
mysql V14.14
php V5.5.9-1ubuntu4.11
Hope someone has some ideas.