My wife has a small client database that I set up on a local stand alone machine. Its a simple 2 table MYSQL DB with a few simple php pages to manage it with. I followed a bouncing ball to create it to run from LOCALHOST and all was fine.
Now I want her to be able to access it from her computer and have it run on my Amahi box. I installed it according to the web-apps instructions and it worked. Well at least the index.html file come up no problem. The problems start when it tries to run an php script. It's more of a PHP issue than Amahi, I think...
The question is what do I need to change the word LOCALHOST to so that the connection is established? I thought it would just be the IP address or url of my amahi box but this doesn't seem to work. I can connect to the mysql database from my laptop from mysql command line.
Do I have to change other stuff in the mysql setup on the amahi box? Am I missing something really obvious?
Bradford
Here is the connection bit of my php code.
Code: Select all
<body OnLoad="document.getclient.client.focus();">
<form name = getclient action="SQLgetclient.php" method="get">
<?php
define ('MYSQL_HOST','localhost');
define ('MYSQL_USER','user');
define ('MYSQL_PASS','password');
define ('MYSQL_DB','LMM');
$link = mysql_connect('localhost', 'user', 'password');
if (!$link)
//if (mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) )
{
die('Failed to connect to host "' . MYSQL_HOST . '".');
}
else
{
echo '<br>';
// echo 'Connected to MySQL server ' . MSQL_HOST . ' as user ' . MYSQL_USER . 'on' . MYSQL_DB . '<br>';
};