473,226 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

sorting problem

pradeepjain
563 512MB
i had posted the same code in javascript area !! this i am posting bcos of different problem. as you can see in ma code there is a dropdown called sort ...its sorts the result by the value he selects . its working fine... say a user selects price as the sort thing . so it lists all mobiles with its price range with mobile in some range together . wht i need to do here is in the say there are 4 groups with diff price range and in each range there are 4 mobiles...here i need to sort those 4 mobiles according to names of mobiles.this i am not able to achieve .plzz c ma code .hope the code is clear and ma code too.

ps : please tell me if ma code not according to some standards . how to improve .

product_display.php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  3. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  4. session_start();
  5. $mobile_brand=$_GET['brand'];
  6.  
  7. $price=$_GET['price'];
  8.  
  9. $type=$_GET['type'];
  10.  
  11. $os=$_GET['os'];
  12. $sort=$_GET['sort'];
  13. if($sort == "")
  14.         {
  15.                 $sort = "overall_rating";
  16.         }
  17.  
  18. $sorting_order=$_GET['sort_order'];
  19. if($sorting_order == "")
  20.         {
  21.                 $sorting_order = "Desc";
  22.         }
  23.  
  24. $build_query = "";
  25.         $add = "";
  26.         $append = "";
  27. if($mobile_brand != "")
  28. {
  29.         $append = "yes";
  30.         $build_query .= " property1 = '" .$mobile_brand ."'";
  31. }
  32. if($price != "")
  33. {
  34.         if($append =="yes")
  35.         {
  36.         $add = "and";
  37.         }
  38.         $append = "yes";
  39.         $build_query .= " $add property4 = '" .$price ."'";
  40. }
  41.  
  42. if($type != "")
  43. {
  44.   if($append =="yes")
  45.         {
  46.         $add = "and";
  47.         }
  48.         $append = "yes";
  49.         $build_query .= " $add property3 = '" .$type ."'";
  50. }
  51.  
  52. if($os != "")
  53. {
  54.         if($append =="yes")
  55.         {
  56.         $add = "and";
  57.         }
  58.         $build_query .= " $add property6 = '" .$os ."'";
  59. }
  60. //echo $build_query;
  61. /*$wprice  = $_GET['price'];
  62. $wtype = $_GET['type'];
  63. $wos  = $_GET['os'];
  64. if(($wprice != "")||($wtype != "")||($wos != ""))
  65.         {
  66.                 if($wprice != "")
  67.                 {
  68.                 $sqladd = "where property4 ='" .$wprice ."'";
  69.                 }
  70.                 if($wtype != "")
  71.                 {
  72.                 $sqladd = "where property3 ='" .$wtype ."'";
  73.                 }
  74.                 if($wos != "")
  75.                 {
  76.                 $sqladd = "where property6 ='" .$wos ."'";
  77.                 }
  78.         }
  79.         else
  80.         {
  81.                 $sqladd = "";
  82.         }*/
  83. include_once('db.php');
  84. include_once('valid-scripts/validateData.php');
  85. error_reporting (E_ALL & ~ E_NOTICE);
  86. ?>
  87. <html>
  88. <head>
  89.         <script src="jquery.js" type="text/javascript"></script>
  90.         <script src="jquery.rating.js" type="text/javascript" language="javascript"></script>
  91.         <link href="jquery.rating.css" type="text/css" rel="stylesheet"/>
  92.         <link rel="stylesheet" type="text/css" href="style.css">
  93.  
  94. <script type="text/javascript">
  95. $(document).ready(function() {
  96.     $("#mobile_brand").change(function() {
  97.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  98.  $("#change").html(data);
  99. });
  100.     });
  101.     $("#property3").change(function() {
  102.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  103.  $("#change").html(data);
  104. });
  105.     });
  106.     $("#property4").change(function() {
  107.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  108.  $("#change").html(data);
  109. });
  110.     });
  111.     $("#property6").change(function() {
  112.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  113.  $("#change").html(data);
  114. });
  115.     });
  116.     $("#sort").change(function() {
  117.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val(),sort:$("#sort").val() } ,function(data){
  118.  $("#change").html(data);
  119. });
  120.     });
  121.     $("#sort_order").change(function() {
  122.    $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val(),sort:$("#sort").val(),sort_order:$("#sort_order").val() } ,function(data){
  123.  $("#change").html(data);
  124. });
  125.     });
  126. });
  127. </script>
  128.  
  129. </head>
  130. <body>
  131. <div id="layout">
  132. <br/>
  133. <?php include_once('menu.php');
  134. ?>
  135. <h2>Mobiles</h2>
  136. <?php
  137. $sql1="select distinct(property1) from mobiles";
  138. $result1=mysql_query($sql1);
  139. $myresult = "";
  140. $myresult .= "<form name='' method='POST' action=''>";
  141. $myresult .= "<select name='mobile_brand' id='mobile_brand'>";
  142. $myresult .= "<option value=''>Mobile Brand</option";
  143.         while($row1=mysql_fetch_array($result1))
  144.         {       if($mobile_brand == $row1['property1'])
  145.                 {
  146.                         $selected5 = 'selected';
  147.                 }
  148.                 else
  149.                 {
  150.                         $selected5 = "";
  151.                 }
  152.                 $myresult .= "<option '. $selected5 .' value='".$row1['property1']."'>".$row1['property1']."</option";
  153.         }
  154. $myresult .= "</select>&nbsp;";
  155.  
  156.         $enumFields = getEnumFieldValues('mobiles', 'property4');
  157.         $myresult .=  "<select name='property4' id='property4'>";
  158.         $myresult .= "<option value=''>Price</option";
  159.          foreach($enumFields as $value)
  160.                {
  161.                 $newvalue = str_replace("'","",$value);
  162.                 if($newvalue == $price)
  163.                 {
  164.      $selected = "selected = 'yes'";
  165.                 }
  166.                 else
  167.                 {
  168.                         $selected = "";
  169.                 }
  170.                   $myresult .= '<option '.$selected .' value='.$value.'>'.str_replace("'","",$value).'</option>';
  171.                 }
  172.         $myresult .= "</select>&nbsp;";
  173.  
  174.  
  175.         $enumFields = getEnumFieldValues('mobiles', 'property3');
  176.         $myresult .=  "<select name='property3'id='property3'>";
  177.         $myresult .= "<option value=''>Type</option";
  178.          foreach($enumFields as $value)
  179.                {
  180.                 $newvalue1 = str_replace("'","",$value);
  181.                 if($newvalue1 == $type)
  182.                 {
  183.                         $selected1 = "selected = 'yes'";
  184.                 }
  185.                 else
  186.                 {
  187.                         $selected1 = "";
  188.                 }
  189.                   $myresult .= '<option '. $selected1 .' value='.$value.'>'.str_replace("'","",$value).'</option>';
  190.                }
  191. $myresult .= "</select>&nbsp;";
  192.  
  193.         $enumFields = getEnumFieldValues('mobiles', 'property6');
  194.         $myresult .= "<option value=''></option";
  195.         $myresult .=  "<select name='property6' id='property6' >";
  196.         $myresult .= "<option value=''>Os</option";
  197.          foreach($enumFields as $value)
  198.                {
  199.                 $newvalue2 = str_replace("'","",$value);
  200.                 if($newvalue2 == $os)
  201.                 {
  202.                         $selected2 = "selected = 'yes'";
  203.                 }
  204.                 else
  205.                 {
  206.                         $selected2 = "";
  207.  }
  208.                   $myresult.= '<option '.$selected2 .' value='.$value.'>'.str_replace("'","",$value).'</option>';
  209.                }
  210. $myresult .= "</select> &nbsp;&nbsp;&nbsp;&nbsp;";
  211.  
  212.         $myresult .= "Sort by : ";
  213.         $sort_array = array('Rating' => 'overall_rating','Type' => 'property3','Price' =>'property4','Os' =>'property6');
  214.         $myresult .=  "<select name='sort' id='sort' >";
  215.         foreach ($sort_array  as $name => $value)
  216.         {
  217.                 if($sort == $value)
  218.                 {
  219.                         $selected6 = "selected";
  220.                 }
  221.                 else
  222.                 {
  223.                         $selected6 = "";
  224.                 }
  225.                 $myresult.= '<option '.$selected6 .' value='.$value.'>'.$name.'</option>';
  226.         }
  227. $myresult .= "</select>";
  228.  
  229.         $myresult .= "";
  230.         $sorting_array = array('Desc' => 'Desc','Asc' => 'Asc');
  231.         $myresult .=  "<select name='sort_order' id='sort_order' >";
  232.         foreach ($sorting_array  as $name => $value)
  233.         {
  234.                 if($sorting_order == $value)
  235.                 {
  236.                         $selected7 = "selected";
  237.                 }
  238.                 else
  239.                 {
  240.                         $selected7 = "";
  241.                 }
  242.                 $myresult.= '<option '.$selected7 .' value='.$value.'>'.$name.'</option>';
  243.         }
  244. $myresult .= "</select>";
  245.  
  246.  
  247. $myresult .= "</form>";
  248. $sql2 = "select *  from mobile_master";
  249. $result2 = mysql_query($sql2);
  250. $myresult .="<div id='change'>";
  251.  
  252. $perpage = 5;
  253. $lynx = $html = "";
  254. $startat = $_REQUEST[page] * $perpage;
  255. if($build_query  != "")
  256.         {
  257.                 $resultcount = mysql_query("select * from mobiles where $build_query");
  258.         }
  259.         else
  260.         {
  261.                 $resultcount = mysql_query("select * from mobiles");
  262.         }
  263. $rowcount = mysql_num_rows($resultcount);
  264. $myresult .= "<center>Your search got $rowcount mobiles</center>";
  265. $pages = floor(($rowcount + $perpage - 1) / $perpage);
  266. //echo $rowcount;
  267. //echo $pages;
  268. //$pages=$pages-1;
  269. if($build_query  != "")
  270.         {
  271.                 $sql="select * from mobiles where $build_query order by $sort $sorting_order limit $startat,$perpage";
  272.         }
  273.         else
  274.         {
  275.                 $sql="select * from mobiles order by $sort $sorting_order limit $startat,$perpage";
  276.         }
  277. //echo $sql;
  278. $result=mysql_query($sql);
  279. $i=0;
  280. while($row=mysql_fetch_array($result)){
  281. $sqlr="select overall_rating from mobiles where property1='". $row['property1']."' and property2='". $row['property2']."'";
  282. $resultr=mysql_query($sqlr);
  283. $rating = mysql_fetch_array($resultr);
  284.     $myresult .= "<div id='top-rated'>";
  285.     $myresult .= "<div class='image'>";
  286.  
  287. if($row['pic'] != ""){
  288. $myresult .= "<a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='picdisplay.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'</img></a>";
  289. }
  290. else
  291. {
  292. }
  293.         $myresult .= "</div>";
  294.  
  295.         $myresult .= "<div class='rating'>";
  296.  
  297.                 $i++;
  298.                 for($k = 1; $k <= 10; $k++)
  299.                 {
  300.                         if($rating['overall_rating'] == $k)
  301.                         {
  302.                                 $chk ="checked";
  303.                         }
  304.                         else
  305.                         {
  306.                                 $chk = "";
  307.                         }
  308.                         $myresult .= "<input class='star' type='radio' name='rating".$i."' id='rating".$i."' value='". $k ."' $chk title='". $k." out of 10 ' disabled/>&nbsp;&nbsp;";
  309.                 }
  310.         $myresult .= "</div>";
  311.         $myresult .= "<div class='price'>";
  312.         $myresult .= "Price Range : <a href='product_display.php?price=". $row['property4']."'>".$row['property4'] . "</a>";
  313.         $myresult .= "</div>";
  314.         $myresult .= "<div class='Type'>";
  315.         $myresult .= "Type &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <a href='product_display.php?type=". $row['property3']."'>". $row['property3']."</a>";
  316.         $myresult .= "</div>";
  317.         $myresult .= "<div class='os'>";
  318.         $myresult .= "Os  &nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;<a href='product_display.php?os=". $row['property6']."'>". $row['property6']."</a>";
  319.         $myresult .= "</div>";
  320.  
  321.         $myresult .= "<div  class='product-name'>";
  322.         $myresult .= $row['property1']."&nbsp;".$row['property2'];
  323.         $myresult .= "</div>";
  324.         $myresult .= "</div>";
  325. }
  326. for ($k=0; $k<$pages; $k++) {
  327.         if ($k != $_REQUEST[page]) {
  328.          $lynx1 .= " <a href='http://192.168.2.213/rating1/product_display.php?page=".$k."&brand=".$_GET['brand']."&type=".$_GET['type']."&os=".$_GET['os']."&price=".$_GET['price']."&sort=".$_GET['sort']."&sort_order=". $_GET['sort_order']."'>".($k+1)."</a>";
  329.         } else {
  330.  $lynx1 .= " <b>--".($k+1)."--</b>";
  331.         }
  332. }
  333. $myresult .= "<p align='right'>";
  334. $myresult .= $lynx1;
  335. $myresult .= "</p>";
  336. $myresult .="</div>";
  337.  
  338. $myresult .="</div>";
  339.  
  340. echo $myresult;
  341. ?>
  342. <br/>
  343. <br/>
  344. </body>
  345. </html>
  346.  
mobile_change.php
Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3. require_once('db.php');
  4. include_once('valid-scripts/validateData.php');
  5. $_POST=snipExtras($_POST);
  6. $mobile_brand=$_POST['brand'];
  7.  
  8. $price=$_POST['price'];
  9.  
  10. $type=$_POST['type'];
  11.  
  12. $os=$_POST['os'];
  13.  
  14. $sort = $_POST['sort'];
  15. if($sort == "")
  16.  {
  17.         $sort = "overall_rating";
  18.  }
  19.  
  20. $sort_order = $_POST['sort_order'];
  21. if($sort_order == "")
  22.  {
  23.         $sort_order = "desc";
  24.  }
  25. $build_query = "";
  26.         $add = "";
  27.         $append = "";
  28. if($mobile_brand != "")
  29. {
  30.         $append = "yes";
  31.         $build_query .= " property1 = '" .$mobile_brand ."'";
  32. }
  33. if($price != "")
  34. {
  35.         if($append =="yes")
  36.         {
  37.         $add = "and";
  38.         }
  39.         $append = "yes";
  40.         $build_query .= " $add property4 = '" .$price ."'";
  41. }
  42.  
  43. if($type != "")
  44. {
  45.         if($append =="yes")
  46.         {
  47.         $add = "and";
  48.         }
  49.         $append = "yes";
  50.         $build_query .= " $add property3 = '" .$type ."'";
  51. }
  52.  
  53. if($os != "")
  54. {
  55.         if($append =="yes")
  56.         {
  57.         $add = "and";
  58.         }
  59.         $build_query .= " $add property6 = '" .$os ."'";
  60. }
  61.  
  62. $myresult = "";
  63. $myresult .= "<script>";
  64. $myresult .= "$('input[type=radio].star').rating()";
  65. $myresult .= "</script>";
  66.  
  67. ;
  68. $myresult .="<div id='change'>";
  69. $sql2 = "select *  from mobile_master";
  70. $result2 = mysql_query($sql2);
  71. $perpage = 5;
  72. $lynx = $html = "";
  73. $startat = $_REQUEST[page] * $perpage;
  74. if($build_query != ""){
  75. $resultcount = mysql_query("select * from mobiles where $build_query");
  76. $rowcount = mysql_num_rows($resultcount);
  77. $myresult .= "<center>Your search got $rowcount mobiles</center>";
  78. $pages = floor(($rowcount + $perpage - 1) / $perpage);
  79. //$pages=$pages-1;
  80.  
  81. $sql="select * from mobiles where $build_query ";
  82. $result=mysql_query($sql);
  83. $count = mysql_num_rows($result);
  84.  
  85. if($count > 0){
  86. $sql="select * from mobiles where $build_query order by $sort $sort_order  limit $startat,$perpage";
  87. $i=0;
  88. while($row=mysql_fetch_array($result))
  89. {
  90.         $sqlr="select overall_rating from mobiles where property1='". $row['property1']."' and property2='". $row['property2']."'";
  91.         $resultr=mysql_query($sqlr);
  92.         $rating = mysql_fetch_array($resultr);
  93.         $myresult .= "<div id='top-rated'>";
  94.         $myresult .= "<div class='image'>";
  95.         if($row['pic'] != "")
  96.         {
  97.                 $myresult .= "<a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='picdisplay.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'</img></a>";
  98.         }
  99.         else
  100.         {
  101.                 $myresult .= "<a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='images/no-image.gif' width='50' height='70'</img></a>";
  102.         }
  103.         $myresult .="</div>";
  104.  
  105.         $myresult .= "<div class='rating'>";
  106.         $i++;
  107.         for($k = 1; $k <= 10; $k++)
  108.         {
  109.                 if($rating['overall_rating'] == $k)
  110.                 {
  111.                         $chk ="checked";
  112.                 }
  113.                 else
  114.                 {
  115.                         $chk = "";
  116.                 }
  117.                 $myresult .= "<input class='star' type='radio' name='rating".$i."' id='rating".$i."' value='". $k ."' $chk title='". $k." out of 10 ' disabled/>&nbsp;&nbsp;";
  118.         }
  119.         $myresult .="</div>";
  120.         $myresult .= "<div class='price'>";
  121.         $myresult .= "Price Range : <a href='product_display.php?price=". $row['property4']."'>".$row['property4'] . "</a>";
  122.         $myresult .= "</div>";
  123.         $myresult .= "<div class='Type'>";
  124.         $myresult .= "Type &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <a href='product_display.php?type=". $row['property3']."'>". $row['property3']."</a>";
  125.   $myresult .= "</div>";
  126.         $myresult .= "<div class='os'>";
  127.         $myresult .= "Os  &nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;<a href='product_display.php?os=". $row['property6']."'>". $row['property6']."</a>";
  128.         $myresult .= "</div>";
  129.         $myresult .= "<div  class='product-name'>";
  130.         $myresult .= $row['property1']."&nbsp;".$row['property2'];
  131.         $myresult .="</div>";
  132.         $myresult .="</div>";
  133.  
  134. }
  135.  
  136. }
  137. else if($count == 0 && $build_query != ""){
  138. $myresult .= "<p class='message'>Sorry No Product Yet available for Display </p>";
  139. }
  140.  
  141. }
  142. else if($build_query == ""){
  143. $resultcount = mysql_query("select * from mobiles");
  144. $rowcount = mysql_num_rows($resultcount);
  145. $myresult .= "<center>Your search got $rowcount mobiles</center>";
  146. $pages = ($rowcount + $perpage - 1) / $perpage;
  147. $pages=$pages-1;
  148. $sql="select * from mobiles order by $sort $sort_order limit $startat,$perpage";
  149. $result=mysql_query($sql);
  150. $i=0;
  151. while($row=mysql_fetch_array($result))
  152. {
  153.         $sqlr="select overall_rating from mobiles where property1='". $row['property1']."' and property2='". $row['property2']."'";
  154.         $resultr=mysql_query($sqlr);
  155.         $rating = mysql_fetch_array($resultr);
  156.  
  157.         $myresult .= "<div id='top-rated'>";
  158.         $myresult .= "<div class='image'>";
  159.  
  160.  
  161.         if($row['pic'] != "")
  162.         {
  163.                 $myresult .= "<a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='picdisplay.php?brand=". $row['property1'] . "&model=".$row['property2']                                . "'</img></a>";
  164.         }
  165.                              else
  166.         {
  167.                 $myresult .= "<a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='images/no-image.gif' width='50' height='70'</img></a>";
  168.         }
  169.         $myresult .= "</div>";
  170.  
  171.         $myresult .= "<div class='rating'>";
  172.                 $i++;
  173.                 $myresult .= "<td>";
  174.                 for($k = 1; $k <= 10; $k++)
  175.                 {
  176.                         if($rating['overall_rating'] == $k)
  177.                         {
  178.                                 $chk ="checked";
  179.                         }
  180.                         else
  181.                         {
  182.                                 $chk = "";
  183.                         }
  184.                         $myresult .= "<input class='star' type='radio' name='rating".$i."' id='rating".$i."' value='". $k ."' $chk title='". $k." out of 10 ' disabled/>&nbsp;&nbsp;";
  185.                 }
  186.         $myresult .= "</div>";
  187.         $myresult .= "<div class='price'>";
  188.         $myresult .= "Price Range : <a href='product_display.php?price=". $row['property4']."'>".$row['property4'] . "</a>";
  189.         $myresult .= "</div>";
  190.         $myresult .= "<div class='Type'>";
  191.         $myresult .= "Type &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <a href='product_display.php?type=". $row['property3']."'>". $row['property3']."</a>";
  192.         $myresult .= "</div>";
  193.         $myresult .= "<div class='os'>";
  194.         $myresult .= "Os  &nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;<a href='product_display.php?os=". $row['property6']."'>". $row['property6']."</a>";
  195.         $myresult .= "</div>";
  196.  
  197.         $myresult .= "<div  class='product-name'>";
  198.         $myresult .= $row['property1']."&nbsp;".$row['property2'];
  199.         $myresult .="</div>";
  200.         $myresult .="</div>";
  201.  
  202. }
  203. }
  204. for ($k=0; $k<$pages; $k++) {
  205.         if ($k != $_REQUEST[page]) {
  206.          $lynx1 .= " <a href='http://192.168.2.213/rating1/product_display.php?page=".$k."&brand=".$_POST['brand']."&type=".$_POST['type']."&os=".$_POST['os']."&price=".$_POST['price']."&sort=".$_POST['sort']."&sort_order=".$_POST['sort_order']."'>".($k+1)."</a>";
  207.  
  208. //         $lynx1 .= " <a href=http://192.168.2.213/rating1/product_display.php"."?page=$k>".($k+1)."</a>";
  209.         } else {
  210.          $lynx1 .= " <b>--".($k+1)."--</b>";
  211.         }
  212. }
  213. $myresult .= "<p align='right'>";
  214. $myresult .= $lynx1;
  215. $myresult .= "</p>";
  216.  
  217. $myresult .="</div>";
  218. echo $myresult;
  219.  
  220. ?>
  221.  
1
Nov 12 '09 #1
4 1963
Canabeez
126 100+
Hey, you are using $.post jQuery method and have a lot of $_GET in your php code, you sure that is not the case?

About coding standards you might want to check out this, or this.
Nov 16 '09 #2
pradeepjain
563 512MB
i am new to jquery ..so lots of loose ends in codes are there !!! say when the result form DB is paginated like (1,2,3) when the user clicks on 1 or 2 or 3 . i did not know how to use jquery here so i passed the values through url when paginating and stuff!! so i posted the whole code !!!!
Nov 16 '09 #3
Canabeez
126 100+
try using $.get instead $.post or change the $_GET to $_POST
Nov 16 '09 #4
pradeepjain
563 512MB
okie!!thanks for the help!!Will look into it !!!
Nov 16 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors sorted_feature_vector=feature_vectors.keys()...
9
by: jwedel_stolo | last post by:
Hi I'm creating a dataview "on the fly" in order to sort some data prior to writing out the information to a MS SQL table I have used two methods in order to determine the sort order of the...
7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
4
by: John Bullock | last post by:
Hello, I am at wit's end with an array sorting problem. I have a simple table-sorting function which must, at times, sort on columns that include entries with nothing but a space (@nbsp;). I...
4
by: FBM | last post by:
Hi, I am working on a program that simulates one of the elements of ATM. The simulation stores events which occurs every some milliseconds for a certain amount of time. Every time that an event...
4
by: Ambica Jain | last post by:
Hi, I want custom sorting on some of the columns in the datagrid. And i am able to do the same by overriding MouseDown event. However, i need to rebind my datatable to reflect the changes in...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
1
by: Ahmed Yasser | last post by:
Hi all, i have a problem with the datagridview sorting, the problem is a bit complicated so i hope i can describe in the following steps: 1. i have a datagridview with two columns...
1
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar...
7
Plater
by: Plater | last post by:
I am having trouble determining when my DataGridView object is sorting (based on a column header click). The idea is, in a large table, sorting the columns takes time, so I show a splash screen....
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.