OK. I got one of the tools running. It shows that PHP actualy does contact MySQL server. Only it doesn't seem to produce any output on the page.
that's the code I use. IT should be alright. although a second opinion would be apriciated
<html>
<head>
<titlte></title>
</head>
<body>
<?php
$host = "127.0.0.1:3306";
$user = "php";
$password = "*******";
$connection = mysql_connect($host,$user,$password)
or die ("Couldn't connect to a server");
$db = mysql_select_db("tourism", $connection)
or die ("Couldn't find database");
$query ="SELECT FROM hotels";
$result = mysql_query ($query)
or die ("couldn't execute");
if(!$result) die("Query Failed.");
$num = mysql_numrows($result);
mysql_close($connection);
$count = 0;
while ($count < $num) {
$hotelID=mysql_result($result,$i,"Hotel_ID");
$hotelName=mysql_result($result,$i,"Hotel_Name");
echo "<b>$hotelID $hotelName</b";
$count++;
}
?>
</body>
</html>




Reply With Quote