darkfreaks Posted February 28, 2008 Share Posted February 28, 2008 ok so i get mysql_result unable to jump to row. anyone got any ideas how to fix? <?php ini_set('error_reporting',E_ALL); $strTitle = "Topic messages"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $logname = stripslashes($qls->user_info['username']); $catid = $qls->Security->make_safe($_GET['catid']); $covid = $qls->Security->make_safe($_GET['covid']); $page = $qls->Security->make_safe($_GET['page']); if (empty($logname)) { echo "You MUST be logged in to view this page"; }else{ include ('config.php'); $query1=trim(mysql_real_escape_string($query1)); $query1 = "SELECT * FROM vc_coven WHERE id='$covid'"; $result1 = mysql_query($query1); $num= mysql_fetch_row($result1); mysql_close(); $i=0; while ($i < $num) { $header = mysql_result($result1,$i,"header"); $name = mysql_result($result1,$i,"name"); include ('config.php'); $query6=trim(mysql_real_escape_string($query6)); $query6 = "SELECT * FROM vc_covenmembers WHERE covenname='$name' AND username='$logname'"; $result6 = mysql_query($query6); $num=mysql_num_rows($result6); mysql_close(); $i=0; for ($i = 0; $i < $num; $i++) { $status = mysql_result($result6,$i,"status"); echo "<form method='post' action='delete.php'> <input type='hidden' name='catid' value='$covid'> $header <a href='../covens/$name'><h2>$name</h2></a>"; include ('config.php'); $localhost = "mysql1.100ws.com"; $dbuser = "chrxtr2_dbase"; $dbpass = "l0v3sux"; $dbtable = "chrxtr2_dbase"; $site_url = "http://vampirecity.cx-music.com"; $conn = mysql_connect("$localhost","$dbuser","$dbpass") or die("Error Could not connect"); mysql_select_db($dbtable); $query3=trim(mysql_real_escape_string($query3)); $query3 = "SELECT * FROM vc_coventopics WHERE catid='$catid'"; $result3 = mysql_query($query3); $numrows=mysql_num_rows($result3); mysql_close(); $i=0; while ($i < $num) { $username = mysql_result($result3,$i,"username"); $date = mysql_result($result3,$i,"date"); $message = mysql_result($result3,$i,"message"); $title = mysql_result($result3,$i,"title"); echo "<table width=\"60%\" cellpadding=\"0\" cellspacing=\"0\"> <tr valign='top'> <td width=\"10%\" align=\"center\"> <a href=\"../profile/$username\"><br>$username</a><br> </td> <td width=\"50%\"> <table border=\"0\" width=\"100%\" class=\"titlebar\"> <tr><td align=\"left\"><B>$title</B></td><td align=\"right\"> $date </td></tr> </table> $message </td></tr> </table> "; $i++; }; echo "<p>"; include ('config.php'); $limit = 25; $query_count = "SELECT count(*) FROM vc_covenmessages WHERE catid='$catid'"; $result_count = mysql_query($query_count); $totalrows = mysql_num_rows($result_count); if(empty($page)){ $page = 1; } $limitvalue = $page * $limit - ($limit); $query = "SELECT * FROM vc_covenmessages WHERE catid='$catid' ORDER BY `id` LIMIT $limitvalue,25"; $result = mysql_query($query) or die("Error: " . mysql_error()); if(mysql_num_rows($result) == 0){ echo(""); } while($row = mysql_fetch_array($result)){ } if($page != 1){ $pageprev = $page--; echo("<a href=\"board.php?catid=$catid&covid=$covid&page=$pageprev\">PREV".$limit."</a> "); }else{ echo("PREV".$limit." "); } $numofpages = $totalrows / $limit; for($i = 1; $i <= $numofpages; $i++){ if($i == $page){ echo($i." "); }else{ echo("<a href=\"board.php?catid=$catid&covid=$covid&page=$i\">$i</a> "); } } if(($totalrows % $limit) != 0){ if($i == $page){ echo($i." "); }else{ echo("<a href=\"board.php?catid=$catid&covid=$covid&page=$i\">$i</a> "); } } if(($totalrows - ($limit * $page)) > 0){ $pagenext = $page++; echo("<a href=\"board.php?catid=$catid&covid=$covid&page=$pagenext\">NEXT".$limit."</a> "); }else{ echo("NEXT".$limit); } mysql_free_result($result); mysql_close(); include ('config.php'); $query4=trim(mysql_real_escape_string($query4)); $query4 = "SELECT * FROM vc_covenmessages WHERE catid='$catid' ORDER BY `id` LIMIT $limitvalue,$limit"; $result4 = mysql_query($query4) or die("Error: " . mysql_error()); $numrows=mysql_num_rows($result4); mysql_close(); $i=0; while ($i < $num) { $id = mysql_result($result4,$i,"id"); $username = mysql_result($result4,$i,"username"); $date = mysql_result($result4,$i,"date"); $message = mysql_result($result4,$i,"message"); $title = mysql_result($result4,$i,"title"); echo "<table width=\"60%\" cellpadding=\"0\" cellspacing=\"0\" class=\"cmessage\"> <tr valign='top'> <td width=\"10%\" align=\"center\"> <a href=\"../profile/$username\"><br>$username</a><br>"; if ($status=="owner") { echo "<input type='checkbox' name='id' value='$id'>"; }; if ($status=="admin") { echo "<input type='checkbox' name='id' value='$id'>"; }; echo "</td> <td width=\"50%\"> <table border=\"0\" width=\"100%\" class=\"titlebar\"> <tr><td align=\"left\"><B>$title</B></td><td align=\"right\"> $date </td></tr> </table> $message </td></tr> </table> "; $i++; }; if ($status=="owner") { echo "<input type='submit' name='deletemessage' value='Delete Message'>"; }; if ($status=="admin") { echo "<input type='submit' name='deletemessage' value='Delete Message'>"; }; echo "</form>"; ?> <p> <form name="sendmessage" id="sendmessage" method="post" action="messageleft.php"> <input type="hidden" name="date" id="date" value="<?php $date_time = date('l M d, Y g:i A'); echo ($date_time); ?>(GMT)"> <input type="hidden" name="username" value="<?php echo $logname; ?>"><br> <input type="hidden" name="catid" value="<?php echo $catid; ?>"><br> <input type="hidden" name="covid" value="<?php echo $covid; ?>"><br> <br> Title <input type="text" name="title" id="title" value="<?php echo $title; ?>"><br> <textarea rows="10" cols="60" name="message" id="message"></textarea> <br> <input type="submit" id="submit" name="submit" value=" Send Message "> </form> <?php }; $i++; }; }; include ('includes/footer.php'); ?> Link to comment https://forums.phpfreaks.com/topic/93596-pagiation-not-working/ Share on other sites More sharing options...
trq Posted February 29, 2008 Share Posted February 29, 2008 Your kidding? Is that an actual error message? Any hint of a line number or which of the many queries may be causing it? Have you tried to debug this yourslef at all? Link to comment https://forums.phpfreaks.com/topic/93596-pagiation-not-working/#findComment-479727 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.