aznjay Posted September 17, 2008 Share Posted September 17, 2008 <div id="contrax"> <? include 'database.php'; if(isset($_GET['id']) && is_numeric($_GET['id'])) { $id = $_GET['id']; $sql = "SELECT * FROM phptut WHERE id='$id'"; $result = mysql_query($sql); if(mysql_num_rows($result) == 1) { $row = mysql_fetch_assoc($result); echo '<div id="titlecon">'; echo $row['title']; echo '</div>'; echo "<br>"; echo '<div id="cont">'; echo $row['article']; echo '</div>'; } } else { $sql = 'SELECT * FROM phptut ORDER BY id ASC'; $result = mysql_query($sql); function strLength($str,$len){ $lenght = strlen($str); if($lenght > $len){ return substr($str,0,$len).'...'; }else{ return $str; } } while($row = mysql_fetch_assoc($result)) { echo '<div id="tutorial"><a href="'.$_SERVER['REQUEST_URI'].'&id='.$row['id'].'">'.$row['title'].'</a></div>'; $str = $row['article']; //The fist part is the string, the second part is how long it can be echo '<div id="tutorial2">'; echo strLength($str,250); echo '<a href="'.$_SERVER['REQUEST_URI'].'&id='.$row['id'].'">Read More</a>'; echo '</div>'; } } ?> </div> I having trouble paginating this...can anyone do a paging? Link to comment https://forums.phpfreaks.com/topic/124700-can-anyone-paginate-this/ Share on other sites More sharing options...
genericnumber1 Posted September 17, 2008 Share Posted September 17, 2008 can anyone do a paging? Yes I having trouble paginating this Show us what you've tried, we can help you through it, but we won't write it for you. Link to comment https://forums.phpfreaks.com/topic/124700-can-anyone-paginate-this/#findComment-644105 Share on other sites More sharing options...
aebstract Posted September 17, 2008 Share Posted September 17, 2008 $$$ =] Link to comment https://forums.phpfreaks.com/topic/124700-can-anyone-paginate-this/#findComment-644135 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.