Jump to content

[SOLVED] Output syntax error


182x

Recommended Posts

Thanks I have used that for the following code which is used to display file links but only if a fiile is available for that record but its not displaying the file links.

 

Where did I go wrong? Thanks again

 

<?php

while($display=mysql_fetch_array($q))
{
     if (empty($display['p'])) {
          $f = "<td></td>";
	  
     }
     else {
          $file = "<td>".$display['p']."</td>";
     }
     
     echo "<tr class='style4'><td>".$display['Id']."</td><td>".$display['s']."</td><td><a href=".$display['f'].">test</a></td></tr>";
}
?>

I'm getting the following error with this line of code now, just wondering where the syntax is wrong with it.

 


$f = "<td><a href=\"$display['p']\">".$display['p']."</a></td>";

 

error:

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\a\tec.php on line 83

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.