dgnzcn Posted November 27, 2009 Share Posted November 27, 2009 this is my detail page. but my letter pagination does not show any results on the same page ? i need quick help please. <?php require_once('Con/ad.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $currentPage = $_SERVER["PHP_SELF"]; $maxRows_Recordset1 = 10; $pageNum_Recordset1 = 0; if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; $colname_Recordset1 = "-1"; if (isset($_GET['ureticimenu'])) { $colname_Recordset1 = $_GET['ureticimenu']; } mysql_select_db($database_adminpaneli, $adminpaneli); $query_Recordset1 = sprintf("SELECT * FROM urunler WHERE ureticimenu = %s", GetSQLValueString($colname_Recordset1, "text")); $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1, $adminpaneli) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); } $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1; $queryString_Recordset1 = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Recordset1") == false && stristr($param, "totalRows_Recordset1") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams)); } } $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1); ?> <style type="text/css"> <!-- .tablo { float: left; border: 1px solid #FFC1C1; } .urun_adi { font-family: Verdana, Geneva, sans-serif; font-size: 16px; color: #03C; font-weight: bold; } .ba { font-family: Verdana, Geneva, sans-serif; font-size: 11px; color: #C3C3C3; } .marka { font-family: Verdana, Geneva, sans-serif; color: #601806; font-size: 16px; font-weight: bold; text-indent: 15px; } .aciklama { font-family: Verdana, Geneva, sans-serif; font-size: 12px; color: #333; font-weight: bold; } .pdf_ { font-family: Verdana, Geneva, sans-serif; font-size: 10px; color: #C00; } .aciklama_ince { font-family: Verdana, Geneva, sans-serif; font-size: 11px; color: #333; font-weight: normal; } --> </style> <table width="790" border="0" align="center" cellpadding="0" cellspacing="0" id="ad"> <tr> <td height="42" colspan="2" bgcolor="#FFFFFF" class="pdf_"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" class="pdf_"><?php $alpha = range('A','Z'); function linkify(&$letter) { $letter = "<a href=index.php?gogo=ureticidetay&'?l={$letter}'>{$letter}</a>"; } array_walk($alpha,'linkify'); $alpha = implode(' - ',$alpha); echo $alpha; $search = (in_array(strtolower($_GET['l']),range('a','z')))? $_GET['l'] : 'A'; $sql = mysql_query("SELECT * FROM urunler WHERE ureticimenu LIKE '{$search}%'"); while($row = mysql_fetch_array($sql)) { echo "<br/>"; echo $row['ureticimenu']; } ?> </td> </tr> </table></td> </tr> <tr> <td colspan="2" align="center" bgcolor="#FFFFFF" class="pdf_"> </td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF" class="marka"><?php echo $row_Recordset1['uretici']; ?></td> </tr> <tr> <td width="644" bgcolor="#FFFFFF" class="marka"><span class="ba"> </span></td> <td width="645" bgcolor="#FFFFFF" class="marka"> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="#FCFCFC"><?php do { ?> <table width="792" border="0" align="center" cellpadding="0" cellspacing="0" class="tablo"> <tr> <td width="11"> </td> <td width="695" class="urun_adi"><span class="urun_adi"><?php echo $row_Recordset1['ad']; ?></span></td> <td width="75" align="left" class="pdf_"><table width="65" border="0" align="right" cellpadding="0" cellspacing="0"> <tr> <td width="45" class="pdf_">Belge: </td> <td align="right"><a href="urunler/<?php echo $row_Recordset1['pdf']; ?>" target="_blank"><img src="urunler/pdf.gif" width="20" hspace="5" vspace="5" border="0" /></a></td> </tr> </table></td> <td width="9" align="left" class="pdf_"> </td> </tr> <tr> <td height="10" colspan="4" align="center"><img src="images/urun_detay_line.gif" width="98%" height="1" align="baseline" /></td> </tr> <tr> <td width="11" align="left"> </td> <td colspan="2" align="left" class="aciklama_ince"><div align="justify"><a href="urunler/<?php echo $row_Recordset1['image']; ?>" class="highslide" id="thumb3" onclick="return hs.expand(this)"> <img src="urunler/<?php echo $row_Recordset1['image']; ?>" alt="" width="150" hspace="10" vspace="5" border="0" align="left" title="Büyüt" /></a><a class="highslide" onclick="return hs.expand(this)"></a></div> <?php echo $row_Recordset1['aciklama']; ?></td> <td align="left" valign="bottom"> </td> </tr> <tr> <td align="left"> </td> <td colspan="3" align="left"> </td> </tr> <tr> <td align="left" bgcolor="#CCCCFF"> </td> <td colspan="3" align="left" bgcolor="#CCCCFF"> </td> </tr> </table> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></td> </tr> <tr> <td height="50" colspan="2" align="left" bgcolor="#FFFFE1"> <table border="0"> <tr> <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">First</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Previous</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Next</a> <?php } // Show if not last page ?></td> <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Last</a> <?php } // Show if not last page ?></td> </tr> </table></td> </tr> </table> <?php mysql_free_result($Recordset1); ?> Link to comment https://forums.phpfreaks.com/topic/183127-need-quick-help-please-for-letter-pagination/ Share on other sites More sharing options...
MisterWebz Posted November 27, 2009 Share Posted November 27, 2009 I noticed you have your CSS and HTML code in the same file as your PHP code. Seperate them. Use 1 file for each type of code. Link to comment https://forums.phpfreaks.com/topic/183127-need-quick-help-please-for-letter-pagination/#findComment-966480 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.