this is how is inserted link on line 53.but its giving syntax error.i could not find any mistake as i already put ; at the end of the line but still it is saying missing ; or , please help.

<?php include("../includes/config.php"); ?>
<!DOCTYPE HTML>
<html>
<head>
<title>Admdin Home</title>
<link rel="StyleSheet" href="css/style.css" type="text/css" media="screen">
</head>
<body>
<?php include("includes/header.php"); ?>
<?php include("includes/nav.php"); ?>
<?php include("includes/aside.php"); ?>
<div id="maincontent">

    <div id="breadcrumbs">
        <a href="">Home</a> >
        <a href="">Manage Users</a> >
        List Users
    </div>
    <h2>Teachers List</h2>
</div>
<?php
 if ($_SESSION["isadmin"])
   {

   $con=mysql_connect($dbserver,$dbusername,$dbpassword);
if (!$con)
    {
   die('Could not connect: ' . mysql_error());

    }



mysql_select_db($dbname, $con);
$result = mysql_query("SELECT * FROM accounts WHERE (type='T')");
echo "<table border='1'>
<tr>
<th>E-mail</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Type</th>
<th>EDIT</th>
<th>DELETE</th>
</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
        echo "<td>" . $row['email'] . "</td>";
        echo "<td>" . $row['firstname'] . "</td>";
        echo "<td>" . $row['lastname'] . "</td>";
        echo "<td>" . $row['type'] . "</td>";
        echo "<th><a href="edit-teacher.php">EDIT</a></th> 
        <th><a href="edit-teacher.php">DELETE</a></th>";

  echo "</tr>";
  }
    echo "</table>";

mysql_close($con);
?>

</body>
<?php include("includes/footer.php"); ?>
</html>
<?php
    }
    else
    {
        header("Location: ".$fullpath."login/unauthorized.php");

    }
?>

Line 53 has unescaped double quotes. Use \"

as does line 54
find a code highlighting editor, notepad++ there are dozens, having the colors change as the posted code does on DaniWeb, makes it very easy to find headslap moment errorors

( errorors, headslap moment :) )

echo "<th><a href=edit-teacher.php>EDIT</a></th>
<th><a href=edit-teacher.php>DELETE</a></th>";

use the above code it can work...

just place edit-teacher.php in single quotes rather than placing it in double quotes.. Thats all

Member Avatar
diafol

Backslash the double quotes as noted. Are you sure you want that as a <th> instead of a <td>? A th in the left handed columns are common as they may relate to data categories, but I haven't seen them used for this purpose before. Just a question, not a criticism.

i've checked the code by removing double quotes.it was giving the same error and then i put the link in single quotes its still giving the same error...

which quotes should i backslash?? i couldnt get u..im sorry
yup i can use td as well..i think i wanted to use th..td can solve the problem???

this is my code now..please help

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
    echo "<td>" . $row['email'] . "</td>";
    echo "<td>" . $row['firstname'] . "</td>";
    echo "<td>" . $row['lastname'] . "</td>";
    echo "<td>" . $row['type'] . "</td>";
    echo "<th><a href='edit-teacher.php'>EDIT</a></th> <th><a href='edit-teacher.php'>DELETE</a></th>";
  echo "</tr>";
  }
echo "</table>";

sorry for in convenience..this is what it is saying

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\project\admin\teachers-list.php on line 53
Member Avatar
diafol

When you do this?

echo "<th><a href=\"edit-teacher.php\">EDIT</a></th> <th><a href=\"edit-teacher.php\">DELETE</a></th>";

All one one line?

Your original code was ok, you just need "; at the end of line 53

@diafol i didnt put any backslashes just changed double quotes with single ones and the error is vanished.. :) thanx again