Hi,
I am a Newbie and keep running into a display problem with a script I am trying to make work without success. I need help, please, all I get is an empty page.
Here is my attempted script:
<?php
$db = @mysql_connect("localhost:/home/bdweb8200a/resafrica.net/.database/mysql/mysql.sock","root","Z98WvPSp");
mysql_select_db("test", $db);
if($db) {echo "connected";}
else {echo "database connection failed";}
$query = "SELECT * FROM canyon-hotel LIMIT 0, 20";
$result = @ ($query)
// display results of the submitted query
if (@mysql_num_rows($result) != 0){ // if there are rows then show them
echo"<TABLE BORDER=1><TR>\n";
for ($i = 0; $i < mysql_num_fields($result); $i++) {
echo("<TH>" . mysql_field_name($result,$i) . "</TH>");
}
echo"</TR>\n";
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo("<TR>\n");
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++) {
echo("<TD>" . $row_array[$j] . "</TD>\n");
}
echo("</TR>\n");
}
echo"</TABLE>";
}else{
//echo"No matches.";
}
exit;
?>