I have been working on a PHP project, and i am getting an error in one file i.e
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\simple\directory.php on line 91
My code is:
$s = mysql_query("select * from user_reg where mid='$mid'");
$f = mysql_fetch_array($s);
<?php
while($f = mysql_fetch_array($s))
{ echo "
<div class='divtable'>
<table border='0' cellspacing='10px'>
<tr><td rowspan='4' align='center'><img src='user/$imgsrc' alt='$name' height='100px' width='100px' border='0' title=$name' /></td><th>Name</th><td><?php echo $f['name'];?></td></tr>
<tr><th>Specialized In</th><td><?php echo $f['spl'];?></td></tr>
<tr><th>Degrees</th><td><?php echo $f['de'];?></td></tr>
</table>
</div>";
}
?>
Here i am retrieving the source of image from MySql Database.. I had also tried to overcome this problem by using heredoc syntax..
<?php
while($f = mysql_fetch_array($s))
{ echo <<<abc
<div class='divtable'>
<table border='0' cellspacing='10px'>
<tr><td rowspan='4' align='center'><img src='user/$imgsrc' alt='$name' height='100px' width='100px' border='0' title=$name' /></td><th>Name</th><td>$f['name']</td></tr>
<tr><th>Specialized In</th><td>$f['spl']</td></tr>
<tr><th>Degrees</th><td>$f['de']</td></tr>
</table>
</div>";
abc;
}
?>
But the error is same as the above..
Kindly help me in resolving this issue
I am using this while loop to display my user's details including photograph in my website, is there any loop same as while to do my work.
Thanks in Advance...