Here is what I am trying to do, and I given my little PHP knowledge, I have already gotten so much done. 1-I run PHPmyfaq on my website (a script to crate and display FAQs on your website)
2-I have created a simple script that randomly displays a different FAQ record, everytime you load the home page.
3-Problem is, the whole FAQ article is displayed, and I don't want that. I simply want to dislpay the title of the record, then first 10 words of the article, and then a link for people to click and read the entire article. Like the following:
#*$!: A webmasters and Developers forum, where you can discuss.... (click to read more)
That is it. No more, no less.
Now for the code, this is what I have, but unfortunately, I am missing the code that will limit how many words are displayed, as well as the link to the entire article.
<?php
// Create the connection and select the DB
$link = mysql_connect("host","user","password");
if ($link) {
mysql_selectdb("db",$link);
// Select records from the DB
$query = "SELECT content FROM pmf_faqdata ORDER BY Rand() LIMIT 1";
$result = mysql_query($query);
// Display records from the table
echo "<table border='1'>";
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
echo "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[1]</td></tr>";
}
echo "</table>";
} else {
echo "Can't connect to the database!";
}
?>
I would really appreciate if someone can help me in achieving this?