Jump to content

Please help with syntax


lingo5

Recommended Posts

Hi,

I am using this to output a limited amount of text from my DB:

<?php echo substr($row_texts_RS['descripcion_'.$_SESSION['session_idioma'].''],0,450).'<a href="detail.php"> ... read more</a>';?>

 

as you can see I am also creating the link "read more" that takes you to detail.php.

This works fine...but I need to also pass the record id to the detail page.

I have tried this:

<?php echo substr($row_texts_RS['descripcion_'.$_SESSION['session_idioma'].''],0,450).'<a href="detail.php?id_item=$row_texts_RS['id_item']"> ... read more</a>';?>

...but all I get is a blank page...what am I doing wrong?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/259504-please-help-with-syntax/
Share on other sites

Thanks AyKay47,

I have tried double quotes like so:

 

<?php echo substr($row_texts_RS['descripcion_'.$_SESSION['session_idioma'].''],0,450)."<a href="detail.php?id_item=$row_texts_RS['id_item']"> ... read more</a>";?>

 

But still getting blank page....

Parse error: parse error, expecting `','' or `';'' in C:\wamp\www\newsroom.php on line 250

 

Line 250 is

<?php echo substr($row_texts_RS['descripcion_'.$_SESSION['session_idioma'].''],0,450)."<a href="detail.php?id_item=$row_texts_RS['id_item']"> ... read more</a>";?>

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.