0

I need some help.

I am getting the error Parse error: syntax error, unexpected '<' in:

I wanting to have a text field appear to the right of data output from MYSQL which is just a first and last name. The data from the DB displays great right up until I put in the code for the text field inside the while loop and then I get the error you see above. I am not sure it there is a syntax error or if my code structure is wrong, could someone offer some ideas please?

<html>
<body>
<form action="pts_editing.php" method="post">
<table border="1">

<?php

$con=mysqli_connect("localhost","myusername","mypassword","srrdb");                         
if (mysqli_connect_errno())                         
{
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * From students");                  

$results variable
while($row = mysqli_fetch_array($result))                                   
{
    echo "<tr>"."<td>".$row['fname']."&nbsp".$row['lname']."</td>"."<td>".
                <input type="text" name="dpoints">."</td>"."</tr>";     
}

mysqli_close($con);

?>

</table>
</form>
</body>
</html>
4

1 回答 1

3

您忘记将这部分用单引号括起来:

<input type="text" name="dpoints">
于 2013-05-03T00:11:57.933 回答