PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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:
<?php
mysql_connect("beta.myco.org", "test", "tester") or die(mysql_error());
mysql_select_db("db_test") or die(mysql_error());
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM test")
or die(mysql_error());
echo $result;
echo "<table border='1'>";
echo "<tr> <th>Name</th> <th>Age</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['firstcol'];
echo "</td><td>";
echo $row['seccol'];
echo "</td></tr>";
}
echo "</table>";
?>