I have been looking and working on getting php5 mysql and apache2 working on Suse10 for a couple of weeks now. Here is the problem:
I finally get mysql set up so that I can access it through a terminal, but when I try to retrieve information from mysql with php, I get the header that I have put in HTML but nothing else??
here is the code that I wrote if it helps;
<HTML>
<HEAD>
<TITLE>
Displaying tables with MySQL
</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>Displaying tables with MySQL</H1>
<?php
$connection = mysql_connect("localhost","root","")
or die ("Couldn't connect to server");
$db = mysql_select_db("produce",$connection)
or die ("Couldn't select database");
$query = "SELECT * FROM fruit";
$result = mysql_query($query)
or die("Query failed: ".mysql_error());
echo "<TABLE BORDER='1'>";
echo "<TR>";
echo "<TH>Name</TH><TH>Number</TH>";
echo "</TR>";
while ($row = mysql_fetch_array($result))
{
echo "<TR>";
echo "<TD>", $row['name'], "</TD><TD>", $row['number'], "</TD>";
echo "</TR>";
}
echo "</TABLE>";
mysql_close($connection);
?>
</CENTER>
</BODY>
</HTML>
I get no error messages or anything, just the header and a blank page. I am pretty sure it has something to do with putting --with mysql or something of that nature into some file somewhere but I can't seem to find anyone who can tell me which file or how to set this up from the terminal.
Thanks