Page 1 of 1

How can I resolve this PHP error?

Posted: Mon Jun 29, 2009 5:44 pm
by mikes1471
Hi

I have an error on the code below I'd like help to resolve, the error says "Parse error: syntax error, unexpected '/' in /var/www/vhosts/picfrisky.com/httpdocs/pfupload1/viewalbum.php on line 26"

Wel I do have a '/' on line 26 but it refers to the end of my table :S

Code: Select all

<?php
include("design/header.php");
require("connect.php");
 
$albumid = $_GET['album'];
 
$id = $_SESSION['id'];
 
$image = mysql_query("SELECT * FROM items WHERE userid='$id' AND albumid='$albumid'");
 
echo "<table width='100%' cellpadding='7'>";
while ($row = mysql_fetch_assoc($image))
{
?>
    <tr>
    <td width='220'>
        <?php echo $row['name']."</b><br />".$row['description']; ?> width="400">
    </td>
    <td>
        <font size='2' face='arial'>
        <b><?php echo $row['name']."</b><br />".$row['description']."; ?>
    </td>
    </tr>
<?php
}
echo "</table>";
 
include("design/footer.php");
 
?>

Re: How can I resolve this PHP error?

Posted: Mon Jun 29, 2009 5:59 pm
by BornForCode
You forgot to close a ". This is the correct line (line 21)
<?php echo $row['name']."</b><br />".$row['description']; ?>

Re: How can I resolve this PHP error?

Posted: Mon Jun 29, 2009 6:34 pm
by mikes1471
Thank YOU!!! I gave up on that script months ago cos of errors now with ur help and someone at work earlier today it finally works lol thanks again

Re: How can I resolve this PHP error?

Posted: Mon Jun 29, 2009 6:37 pm
by BornForCode
Try to use a good ide, like eclipse, zend_studio and you will find faster and easier such errors.