dynamic content again
| From: | george | Date: | Fri, 09 Mar 2001 18:35:37 +0000 |
| Subject: | dynamic content again | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-43185@lists.php.net to get a copy of this message | ||
First of all thanks to everyone who has helped me from this ng
but I am afraid I have another question
I am using the code below to pull FAQ out of a database but how do I stop
the next link appearing when the last question is displayed
TIA
george
if ( !isset( $start )){
$start = 0;
}
$num_q = 4;
$sql =" SELECT DISTINCT * FROM $table_name LIMIT $start, $num_q";
$start += 4;
$newStart = $start - $num_q;
$result = @mysql_query($sql, $connection) or die ("Couldnt execute query");
while ($row = mysql_fetch_array($result)) {
echo
"<tr><td
class=\"headline\">$row[headline]</td></tr><tr><td align=left
class=\"answer\">$row[answer]</td
></tr>";
}
echo "</table>";
?></td>
</tr>
<tr>
<td colspan="2"><a href="<? print "$PHP_SELF?newstart=$start?
-
$num_q" ; ?>">Previous</a>
<a href="<? print "$PHP_SELF?start=$start";
?>">Next</a></td>