/    Sign up×
Community /Pin to ProfileBookmark

can’t see error – would somebody help?

I get this :

[QUOTE]

Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in C:xampphtdocshofilescurrentmaint.php on line 12

[/QUOTE]

when I execute this code:
[code=php]:?<?php
mysql_connect(localhost,root,””);
mysql_select_db(maintdb) or die( “Unable to select database”);
if(!empty($_POST[“submit”]))
{
$compmo = $_
POST[‘compmo’];
$query=”SELECT * FROM maintdata Where compmo=’$compmo'”;
$result=mysql_query($query);
if(mysql_num_rows($result))
{
echo “<form action=’#’ method=’post’><b>Poject: Maintenance Log</b><br /><br />;
echo “<table cellspacing=1 cellpadding=1 border=’0′>
<tr>
<TH>Apt</TH>
<TH>Name</TH>
<TH>Received</TH>
<TH>Time</TH>
<TH>Problem</TH>
<TH>Correction</TH>
<TH colspan=3>Finished</TH>
<TH>Ord#</TH>

</tr>”;
while($row = mysql_fetch_array($result))
{
echo “<tr>”;
echo “<td>” . $row[‘apt’] . “</td>”;
echo “<td>” . $row[‘name’] . “</td>”;
echo “<td>” . $row[‘datereceived’] . “</td>”;
echo “<td>” . $row[‘time’] . “</td>”;
echo “<td>” . $row[‘symptom’] . “</td>”;
echo “<td>” . $row[‘action’] . “</td>”;
echo “<td>” . $row[‘compmo’] . “</td>”;
echo “<td>” . $row[‘compday’] . “</td>”;
echo “<td>” . $row[‘compyear’] . “</td>”;
echo “<td>” . $row[‘ordno’] . “</td>”;
echo “</tr>”;
}
echo “</table>”;
mysql_close();
?>
<form method=”post” action=”#”>
<br />
<input type=”text” name=”compmo”/> <p>
<input type=”submit” name=”submit” value=”select maintenance month”/>
</form>[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 18.2010 — Missing closing quote on the first echo.
×

Success!

Help @ckdoublenecks spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...