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>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to