satsujin
07-29-2008, 05:11 PM
Can someone please help with the following problem?
I just installed Apache 2.2.9 and php 5.2.6. I already had mySQL 5.0 installed on the system. Apache and PHP seemed to install okay and a simple PHP file to print text works fine. I can also connect to the mySQL server via the localhost through the mysql cmdline console. However , the following PHP code only displays "hello " :
<HTML>
<HEAD>
<TITLE>DB</TITLE>
</HEAD>
<BODY>
<?php
echo "Hello";
mysql_connect("localhost", "root", "passwd") or die(mysql_error());
echo "Connected<BR>";
?>
</BODY>
</HTML>
I just installed Apache 2.2.9 and php 5.2.6. I already had mySQL 5.0 installed on the system. Apache and PHP seemed to install okay and a simple PHP file to print text works fine. I can also connect to the mySQL server via the localhost through the mysql cmdline console. However , the following PHP code only displays "hello " :
<HTML>
<HEAD>
<TITLE>DB</TITLE>
</HEAD>
<BODY>
<?php
echo "Hello";
mysql_connect("localhost", "root", "passwd") or die(mysql_error());
echo "Connected<BR>";
?>
</BODY>
</HTML>