Paerse 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
aja626
Forum Newbie
Posts: 1
Joined: Thu May 21, 2009 7:55 am

Paerse error

Post by aja626 »

I'm a newbie here.... I've been getting an parse error with the following code can someone help.

Code: Select all

<?php  echo '<a href="details.php?article_id='.$row['article_id'].'">'echo $row['title']'</a>' ; ?>
Error:
Parse error: parse error, expecting `','' or `';''
Last edited by Benjamin on Thu May 21, 2009 8:44 am, edited 1 time in total.
Reason: Added [code=php] tags.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Paerse error

Post by jaoudestudios »

<?php echo '<a href="details.php?article_id='.$row['article_id'].'">'echo $row['title']'</a>' ; ?>
Use this...(you dont need an echo)...

Code: Select all

<?php  echo '<a href="details.php?article_id='.$row['article_id'].'">'.$row['title'].'</a>' ; ?>
myismymxd
Forum Newbie
Posts: 5
Joined: Wed May 20, 2009 10:41 am

Re: Paerse error

Post by myismymxd »

You can write codes like this::

Code: Select all

 
 
<?php  echo " <a href=\"details.php?article_id={$row['article_id']}\">{$row['title']} </a>";
 ?>
 
 
Last edited by Benjamin on Thu May 21, 2009 10:43 am, edited 1 time in total.
Reason: Added [code=php] tags.
Post Reply