PDA

View Full Version : Displaying portion of article and then showing "<a href...>more...</a>"


Yaggles
08-25-2005, 11:27 AM
I am creating a simple support desk thing and want to show the operators a portion of the question on the main page. I can show the title, the name, the subject, etc. but I want to show only, say... 200 characters of the content and then have "<a href="hdesk.php?id=<id>">more...</a>" at the end. I can handle the link with more..., but I can't get the 200 characters only. How might I do it?

Yaggles
08-25-2005, 11:57 AM
YAY! I found it by just looking around online... and I wasn't even necessarily looking for it!

Just figured out that MID(fieldname,startnumber,length) AS fieldname will do just what I wanted!
In my case it was:
SELECT MID(content,1,50) AS content FROM contact;


Thanks anyways, and I hope this helps someone if they were looking for this!

-Yaggles

SpirtOfGrandeur
08-25-2005, 02:27 PM
You should also return the length of the total text. >200 and you show the more text. <=200 you do not show the link ;)

Yaggles
08-26-2005, 07:31 AM
Well, I want to link to the article anyways... I could just instead of doing "more...", I could do "Full Text". It may make it look better...

And for your idea, how I return th full text for that if I already returned the portion of the text for displaying?

-Yaggles