Hi again,
If you read my post about why my keyword viewing script wasnt't working, through the great help of sitepoint members, I have now fixed it, and I am looking to advance further with this script.

What I would like to do is, if the script displays more than a certain number of keywords, it should show them on different pages (e.g. just like search engines do).
I know that this use I MySQL query using the function 'LIMIT', but I am not sure how to implement it in my script, being a beginner.
I'd be very grateful if someone could help me out.

The code to the script in its present state is:

Code:
<table cellspacing=1 cellpadding=1 bgcolor="ffffff" width="420">
<tr bgcolor="ffffff" width=580>
<td width=300 bgcolor=000099>
<a href="<?php echo($PHP_SELF); ?>?sort=keywords"><font class="tenptwhite">
Keywords</a></font></td>
<td width=120 bgcolor=000099>
<a href="<?php echo($PHP_SELF); ?>?sort=popularity"><font class="tenptwhite">Popularity</font></A>
</td>
<td width=100></td>
</tr>

<?php
mysql_connect("localhost", "root", "");
if (!dbcnx) {
echo ("<br>Unable to connect to the database at this time.<br>Sorry AJ!" );
exit(); 
}
mysql_select_db("eliter");
if ($sort == "popularity") {
$result = mysql_query("select * from keywords order by popularity desc" );
while ( $details = mysql_fetch_array($result) ) {
$keyword = $details["keywords"];
$popularity = $details["popularity"];
echo ("
<tr bgcolor=ffffff width=400>
<td width=300>
<a href='http://212.1.157.4/search?query=$keyword&where=web'>$keyword</a><br>
</td>
<td width=120 align=center>
<font class=tenpt>$popularity</font><br>
</td>
<td width=100 align=middle>
<a href='editkeyword.php?keyword=$keyword' class='nineptblue'>
<img src='../edit.gif' border='0'> edit</a></td>
");
}
} elseif  ($sort == "keywords") {
$result = mysql_query(" select * from keywords order by keywords asc" );
while ( $details = mysql_fetch_array($result) ) {
$keyword = $details["keywords"];
$popularity = $details["popularity"];
echo ("
<tr bgcolor=ffffff width=400>
<td width=300>
<a href='http://212.1.157.4/search?query=$keyword&where=web'>$keyword</a><br>
</td>
<td width=120 align=center>
<font class=tenpt>$popularity</font><br>
</td>
<td width=100 align=middle>
<a href='editkeyword.php?keyword=$keyword' class='nineptblue'>
<img src='../edit.gif' border='0'> edit</a></td>
 "); 
} 
} else {
$result = mysql_query("select keywords, popularity from keywords");
while ( $details = mysql_fetch_array($result) ) {
$keyword = $details["keywords"];
$popularity = $details["popularity"];
echo ("
<tr bgcolor=ffffff width=400>
<td width=300>
<a href='http://212.1.157.4/search?query=$keyword&where=web'>$keyword</a><br>
</td>
<td width=120 align=center>
<font class=tenpt>$popularity</font><br>
</td>
<td width=100 align=middle>
<a href='editkeyword.php?keyword=$keyword' class='nineptblue'>
<img src='../edit.gif' border='0'> edit</a></td>
"); 
} }
?>
(I HOPE THIS IS EASIER)

Can someone please help?!!!
-AJ

[Edited by AJ on 10-30-2000 at 03:39 PM]