How can I resolve this PHP error?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mikes1471
Forum Commoner
Posts: 88
Joined: Sat Jan 24, 2009 3:29 pm

How can I resolve this PHP error?

Post 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");
 
?>
Last edited by Benjamin on Mon Jun 29, 2009 11:45 pm, edited 1 time in total.
Reason: Changed code type from text to php.
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: How can I resolve this PHP error?

Post by BornForCode »

You forgot to close a ". This is the correct line (line 21)
<?php echo $row['name']."</b><br />".$row['description']; ?>
mikes1471
Forum Commoner
Posts: 88
Joined: Sat Jan 24, 2009 3:29 pm

Re: How can I resolve this PHP error?

Post 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
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: How can I resolve this PHP error?

Post by BornForCode »

Try to use a good ide, like eclipse, zend_studio and you will find faster and easier such errors.
Post Reply