I have got MySQL Workbench 5.244 installed. I have a server instance created (MySQL55). Everything works perfect inside the workbench.
The problem is when I try to connect to the server on my PHP (version 4.2.1) file.
(Pleasew find header.php and default.php below)
I get the message below:
Warning: Unknown MySQL Server Host 'MySQL55' (0) in c:\webroot\default.php on line 3
Warning: MySQL Connection Failed: Unknown MySQL Server Host 'MySQL55' (0) in c:\webroot\default.php on line 3
Could not connect: Unknown MySQL Server Host 'MySQL55' (0)
I am new to php but this code was working when I had it lodged on an external web server.
Can somenone help?
Thank you.
Mario van Grichen
<?php
$server_name="MySQL55";
$server_user="root";
$server_password="************";
$db_name="a4874781_Genix";
?>
include 'header.php';
$con = mysql_connect($server_name,$server_user,$server_password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($db_name, $con);
$event = mysql_query("SELECT * FROM event WHERE usageTP='M' ORDER BY eventDS");
echo "<table border='0'>
<tr>
<th>Event Type</th>
<th>Description</th>
<th>Usage</th>
</tr>";
while($row = mysql_fetch_array($event))
{
echo "<tr>";
echo "<td>" . $row['eventTP'] . "</td>";
echo "<td>" . $row['eventDS'] . "</td>";
echo "<td>" . $row['usageTP'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?><?php
include 'header.php';
$con = mysql_connect($server_name,$server_user,$server_password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($db_name, $con);
$event = mysql_query("SELECT * FROM event WHERE usageTP='M' ORDER BY eventDS");
echo "<table border='0'>
<tr>
<th>Event Type</th>
<th>Description</th>
<th>Usage</th>
</tr>";
while($row = mysql_fetch_array($event))
{
echo "<tr>";
echo "<td>" . $row['eventTP'] . "</td>";
echo "<td>" . $row['eventDS'] . "</td>";
echo "<td>" . $row['usageTP'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?> <?php
$server_name="MySQL55";
$server_user="root";
$server_password="************";
$db_name="a4874781_Genix";
?>
mgrichen 0 Newbie Poster
LastMitch
mgrichen 0 Newbie Poster
veedeoo 474 Junior Poster Featured Poster
LastMitch
mgrichen 0 Newbie Poster
LastMitch
mgrichen 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.