<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wines</title>
</head>
<body>
<?php
require 1db.inc1;
function displayWines($result)
{
//print "<h1>Our Wines</h1>\n";
print "<table border=\"20\">\n>";
print "<tr><td align=\"center\" colspan=\"1\" bgcolor=\"#ffff99\">";
print "<strong>Our Wines</strong>";
print "\n<table>\n<tr>\n" .
"\n\t<th>Wine ID</th>" .
"\n\t<th>Wine Name</th>" .
"\n\t<th>Type</th>" .
"\n\t<th>Year</th>" .
"\n\t<th>Winery ID</th>" .
"\n\t<th>Description</th>" .
"\n</tr>";
//print "</td></tr>";
while ($row = @ mysql_fetch_row($result))
{
print "\n<tr>";
foreach($row as $data)
print "\n\t<td> {$data} </td>";
print "\n</tr>";
}
print "\n</table>\n";
}
$query = "SELECT * FROM wine";
if (!($connection = @ mysql_connect("host", "root", "password")))
die("Cannot connect");
if (!(mysql_select_db("winestore", $connection)))
showerror();
if (!($result = @ mysql_query ($query, $connection)))
showerror();
displayWines($result);
?>
</body>
</html>
运行后,出现“Parse error: parse error, unexpected T_STRING”这么一个提示,我想问这应该怎么做?为什么会出现这个问题?
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wines</title>
</head>
<body>
<?php
require 1db.inc1;
function displayWines($result)
{
//print "<h1>Our Wines</h1>\n";
print "<table border=\"20\">\n>";
print "<tr><td align=\"center\" colspan=\"1\" bgcolor=\"#ffff99\">";
print "<strong>Our Wines</strong>";
print "\n<table>\n<tr>\n" .
"\n\t<th>Wine ID</th>" .
"\n\t<th>Wine Name</th>" .
"\n\t<th>Type</th>" .
"\n\t<th>Year</th>" .
"\n\t<th>Winery ID</th>" .
"\n\t<th>Description</th>" .
"\n</tr>";
//print "</td></tr>";
while ($row = @ mysql_fetch_row($result))
{
print "\n<tr>";
foreach($row as $data)
print "\n\t<td> {$data} </td>";
print "\n</tr>";
}
print "\n</table>\n";
}
$query = "SELECT * FROM wine";
if (!($connection = @ mysql_connect("host", "root", "password")))
die("Cannot connect");
if (!(mysql_select_db("winestore", $connection)))
showerror();
if (!($result = @ mysql_query ($query, $connection)))
showerror();
displayWines($result);
?>
</body>
</html>
运行后,出现“Parse error: parse error, unexpected T_STRING”这么一个提示,我想问这应该怎么做?为什么会出现这个问题?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货