Using MySql, SQl and PHP, I want to add "read more" link to my articles. Does any body has an idea how to do it?
Couldn't you just hard code the first x words then add the link. Can you tell us more about exactly how you want this to work?
if you use wordpress (php cms) you can add <!--more--> on your post. read more link will be automatic generate
Hard coding is too laborious as I will have to do this for every article. I need some automation. What I am trying to ask is that the main page has only a little portion of the article. which ends with anchor texts like "Read More, Continue Reading" e.t.c Upon clicking this text, I am guided towards the full article. The only thing I have to do is just to submit my article in the database and the rest of the work is done by the coding. I hope this clears a lot.
I know this can be done very easily in wordpress and many other CMS. What I am asking is to have my own.
You can use substr function to cut down the string and at the end add the link where you are showing complete page...
// Display, say, 200 characters of article. echo substr($content_story,0,200) . "...<br />"; // Add link. echo "<a href='link.php?id='" . $id . '">Read More</a>";