0
    <?php

$con=mysql_connect("localhost","root","") or die("Error");
mysql_select_db("college") or die("DB error");
$q=mysql_query("select* from studentinfo");

echo "<table border=1>
<th> Roll No</th>
<th> Name</th>
<th> Class</th>
<th> Update</th>";

while($rows=mysql_fetch_array($q))
{?>
<tr>
<td><? echo $rows[0];?></td>
<td><? echo $rows[1];?></td>
<td><? echo $rows[2];?></td>
</tr>

<? } ?>
</table>

Dear Experts

Kindly check this code and please help to find errors in it. I have just wrote that code it shows errors.

Code is here:

When I just checked it at that place it did not work

Error: Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\2017 work php\updt.php on line 22

at 22 line there is at the end

  • FYI, [you shouldn't use `mysql_*` functions in new code](http://stackoverflow.com/questions/12859942/). They are no longer maintained [and are officially deprecated](https://wiki.php.net/rfc/mysql_deprecation). See the [red box](http://php.net/manual/en/function.mysql-connect.php)? Learn about [*prepared statements*](https://en.wikipedia.org/wiki/Prepared_statement) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://php.net/manual/en/mysqlinfo.api.choosing.php) will help you decide which one is best for you. – John Conde Apr 01 '17 at 13:27
  • ` } ?>` that'll do it. – Funk Forty Niner Apr 01 '17 at 13:41

0 Answers0