cannot connect... something basic wrong?
Posted: Thu Sep 14, 2006 11:28 am
I am on a network that has a beta.mycompany.com - a machine aliased so I can do development work. The beta machine is running PHP and Apache and MySQL.
I am trying to write code that will run on a machine outside of the beta server but still pull data from the beta server.
Can I do this without a public IP? It seems like it should work, since I can type beta.mycompany.com into the address bar and it will work. But, it doesnt seem to. I get a 404 error from the following code:
I am confused.
Thank you.
J
I am trying to write code that will run on a machine outside of the beta server but still pull data from the beta server.
Can I do this without a public IP? It seems like it should work, since I can type beta.mycompany.com into the address bar and it will work. But, it doesnt seem to. I get a 404 error from the following code:
Code: Select all
<html>
<head><title> MySQL Data </title></head>
<body bgcolor="#FFFFFF">
<?
$DBhost = "beta.myco.org";
$DBuser = "user";
$DBpass = "pass";
$DBName = "db_test";
$table = "testtable";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "SELECT * FROM $table";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
$i = 0;
if ($number < 1) {
print "<CENTER><P>There Were No Results for Your Search</CENTER>";
}
else {
while ($number > $i) {
$thename = mysql_result($result,$i,"firstname");
$theemail = mysql_result($result,$i,"lastname");
print "<p><b>Name:</b> $thename<br><b>E-Mail:</b>
$theemail</p>";
$i++;
}
}
?>
</BODY></HTML>Thank you.
J