Hi:
I am an idiot-savant when it comes to coding. I had a script made by someone who didnt know what he was doing, exactly, and for some reason the coding wont work properly. I've looked at everything I could find and nothing has helped me figure this out.
Basically, I have a columns page that will preview the featured column, with a link to click to read the rest, then 20 separate column titles underneath this. Below this, a series of numbers to click to go to different pages with older posts (naturally). What is supposed to happen is that you click the number to go to that page (say 21 to 31), but all that happens is the same list of blog titles that are on the "first page". Take a look here:
http://www.wildtalkradio.com/columns.php. Click the pagination numbers and you'll see what I mean.
Here is the FULL code for this:
CODE
<? $result = mysql_query("SELECT * FROM `columns`"); $total = mysql_num_rows($result);
if(isset($_GET['less'])) { $less = $_GET['less']; } else { $less
= 0; } if(isset($_GET['high'])) { $high = $_GET['high']; } else
{ $high = 15; } ?>
</font><font color="#000000">
<?php
if($result = mysql_query("SELECT * FROM `columns` WHERE featured = 1")) {
$myrow = mysql_fetch_array($result);
$main = substr($myrow['main'], 0, 900);
$user = $myrow['user'];
$userr = mysql_query("SELECT * FROM admin WHERE id = '$user'");
$user = mysql_result($userr,0,'name');
?>
<i><b><a href="./columnview.php?id=<?php echo $myrow['id'] ?>"><?php echo $myrow['title'] ?></a></b></i></font></font></div>
<div align="justify">
<p><font color="#000000" size="2">Posted on <?php echo $myrow['date'] ?></font><font color="#000000"><br>
<font size="2">by <?php echo $user ?>.<br>
<br>
</font></font> <font color="#000000"><?php echo $main ?>...<br>
<font size="1"> <a href="./columnview.php?id=<?php echo $myrow['id'] ?>"><b><i>View
the Rest</i></b></a> </font></font> </p>
<div align="justify"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">
<?php
} else {
?>
Error retrieving featured column.</font><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><font size="1">
<?php
}
if($result = mysql_query("SELECT * FROM `columns` ORDER BY date DESC LIMIT 20")) {
while($myrow = mysql_fetch_array($result)) {
if($myrow['featured'] != 1) {
?>
<a href="./columnview.php?id=<?php echo $myrow['id'] ?>"><b><?php echo $myrow['title'] ?></b></a><br>
<?php
}
}
} else {
?>
Error retrieivng column list.
<?php
}
?>
<br>
<?php
for($i=1, $n=0;$i<=$total;$i+=20, $n++) {
if($i == $less) {
?>
<?php echo $n ?>
<?php
} else {
?>
<a href="./columns.php?less=<?php echo $i ?>&high=<?php echo ($i+20) ?>"><?php echo $n ?></a>
<?php
}
}
?>
This looks a little ugly to me, and I cannot find the fault anywhere... Can someone help?????