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
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....

Link to comment
Share on other sites

Sorry....still no luck.

There must be something wrong with the whole thing

<?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>";?>

:-[

Link to comment
Share on other sites

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>";?>

Link to comment
Share on other sites

"<a href="detail.php?id_item=$row_texts_RS['id_item']"> ... read more</a>"

 

double quotes within double quotes.. you gotta escape the inner double quotes

 

"<a href=\"detail.php?id_item=$row_texts_RS['id_item']\"> ... read more</a>"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.