This is on Windows XP Pro. I've installed Apache2, PHP5 and MySQL 4.0.13.
I am working through a tutorial from codewalkers.com.
Part of the tutorial has you create a some .php files to test to make sure PHP is working. The first two test files work fine, it's when I get to the database connect where it gets fouled up.
Here's the php code:
<HTML>
<?php
$db = mysql_connect("localhost", "root", ""
;
mysql_select_db("learndb",$db);
$result = mysql_query("SELECT * FROM personnel",$db);
echo "<TABLE>";
echo"<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>";
while($myrow = mysql_fetch_array($result))
{
echo "<TR><TD>";
echo $myrow["firstname"];
echo " ";
echo $myrow["lastname"];
echo "<TD>";
echo $myrow["nick"];
echo "<TD>";
echo $myrow["salary"];
}
echo "</TABLE>";
?>
</HTML>
I have already created the tables. But, it doesn't even look like it's getting a chance to connect base on this error message:
Fatal error: Call to undefined function: mysql_connect() in C:\Apache\Apache2\htdocs\viewdb.php on line 3
I am working through a tutorial from codewalkers.com.
Part of the tutorial has you create a some .php files to test to make sure PHP is working. The first two test files work fine, it's when I get to the database connect where it gets fouled up.
Here's the php code:
<HTML>
<?php
$db = mysql_connect("localhost", "root", ""
mysql_select_db("learndb",$db);
$result = mysql_query("SELECT * FROM personnel",$db);
echo "<TABLE>";
echo"<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>";
while($myrow = mysql_fetch_array($result))
{
echo "<TR><TD>";
echo $myrow["firstname"];
echo " ";
echo $myrow["lastname"];
echo "<TD>";
echo $myrow["nick"];
echo "<TD>";
echo $myrow["salary"];
}
echo "</TABLE>";
?>
</HTML>
I have already created the tables. But, it doesn't even look like it's getting a chance to connect base on this error message:
Fatal error: Call to undefined function: mysql_connect() in C:\Apache\Apache2\htdocs\viewdb.php on line 3