php - I get this Error again n again -
this question has answer here:
parse error: syntax error, unexpected end of file in c:\xampp\htdocs\ad10.php on line 22
<?php $c=mysql_connect("localhost","root","") or die("connection error"); mysql_select_db("staff") or die("database error"); $q=mysql_query("select * teachers"); echo "<table border=1> <th>number</th> <th>name</th> <th>shift</th> <th>class</th> <th>update</th> <th>remove</th>"; while($row=mysql_fetch_array($q)) { ?> <tr> <td><? echo $row['name'];?></td> <td><? echo $row['shift'];?></td> <td><? echo $row['class'];?></td> </tr> <? } ?> </table>
can please notify problem code.....
you don't have short tags enabled closing curly, }
, inside <? ?>
doesn't close while
loop.
<?php $c=mysql_connect("localhost","root","") or die("connection error"); mysql_select_db("staff") or die("database error"); $q=mysql_query("select * teachers"); echo "<table border=1> <th>number</th> <th>name</th> <th>shift</th> <th>class</th> <th>update</th> <th>remove</th>"; while($row=mysql_fetch_array($q)) { ?> <tr> <td><?php echo $row['name'];?></td> <td><?php echo $row['shift'];?></td> <td><?php echo $row['class'];?></td> </tr> <?php } ?> </table>
actually after writing noticed name
, shift
, , class
in short tags wouldn't have been outputted maybe wrong?
Comments
Post a Comment