Forum Moderators: coopster
I'm trying to get php to work in my browser because right now I can only get it to work in php editing programs, namely PHPEdit. If I open the file in my browser it doesn't do any of the php code or display any of the echo's. I have wampserver installed which therefore has apache, php, and mysql installed.
I also want to get my database I've created on phpmyadmin to work on the local server I'm connected to. I don't know how to access phpmyadmin from there. I tried to install wampserver onto the local server but if I try to open phpmyadmin I just get a bunch of mumbo jumbo.
Any help would be greatly appreciated. I don't exactly know what's going on here and how some of this stuff is set up so if I have the wrong thought process please tell me.
Thanks
Are you putting your .php files in the web root of your local server? Wampserver is www (http://localhost) I believe. Doesn`t sound like the .php files are parsing.
And when you say you get 'mumbo jumbo' for PHPMyAdmin, can you give us some more information about what you see?
dc
Unable to connect to the " . "database server at this time.
" ); exit(); } // Select the player profile database if (! @mysql_select_db("player profile") ) { echo( "
Unable to locate the " . "database at this time.
" ); exit(); } echo("
Here are all the names " . "in the database:
"); // Request the text of all the names $result = mysql_query( "SELECT * FROM player_info"); if (!$result) { echo("
Error performing query: " . mysql_error() . "
"); exit(); } // Display the text of the names while ( $row = mysql_fetch_array($result) ) { echo("
" . $row["Name"] . "
"); } ?>
And here's what's in the .php file. I'm just doing a basic pulling names from my database:
<HTML>
<head><title>testing</title></head>
<BODY><?php
$dbcnx = @mysql_connect("localhost",
"root", "");
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
// Select the player profile database
if (! @mysql_select_db("player profile") ) {
echo( "<P>Unable to locate the " .
"database at this time.</P>" );
exit();
}
echo("<P> Here are all the names " .
"in the database: </P>");
// Request the text of all the names
$result = mysql_query(
"SELECT * FROM player_info");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>");
exit();
}
// Display the text of each name
while ( $row = mysql_fetch_array($result) ) {
echo("<P>" . $row["Name"] . "</P>");
}
?>
</BODY>
</HTML>
and thanks for the welcome :)