Warning message? & NEXT page of ´results' not showing any results?

Reply

Join Date: Oct 2009
Posts: 7
Reputation: LindaLou is an unknown quantity at this point 
Solved Threads: 0
LindaLou LindaLou is offline Offline
Newbie Poster

Warning message? & NEXT page of ´results' not showing any results?

 
0
  #1
Oct 30th, 2009
Hi,

I am getting 3 warning messages below:

Warning: mysql_free_result() expects parameter 1 to be resource, null given in J:\xampp\htdocs\propertypages\resultsForSale.php on line 660

Warning: mysql_free_result() expects parameter 1 to be resource, null given in J:\xampp\htdocs\propertypages\resultsForSale.php on line 662

Warning: mysql_free_result() expects parameter 1 to be resource, null given in J:\xampp\htdocs\propertypages\resultsForSale.php on line 664

My search / results page was working but not getting specific enough results, so i put in a php switch case to check if the varibles passed were the default values from the 'please select an option from the menu´field. This work perfectly and now gets all the correct results i want.
  1. $varloc2_RsSearchForSale2 = "-1";
  2. if (isset($_POST['location'])) {
  3. $varloc2_RsSearchForSale2 = $_POST['location'];
  4. }
  5. $varprice2_RsSearchForSale2 = "-1";
  6. if (isset($_POST['price'])) {
  7. $varprice2_RsSearchForSale2 = $_POST['price'];
  8. }
  9. $vartype2_RsSearchForSale2 = "-1";
  10. if (isset($_POST['type'])) {
  11. $vartype2_RsSearchForSale2 = $_POST['type'];
  12. }
  13. $varbed2_RsSearchForSale2 = "-1";
  14. if (isset($_POST['beds'])) {
  15. $varbed2_RsSearchForSale2 = $_POST['beds'];
  16. }
  17. switch (true) {
  18. case ($varloc2_RsSearchForSale2 == 'def'):
  19. case ($varprice2_RsSearchForSale2 == 'def'):
  20. case ($vartype2_RsSearchForSale2 == 'def'):
  21. case ($varbed2_RsSearchForSale2 == 'def'):
  22. mysql_select_db

NOW i have the problem with the warning message AND my repeating region is not working, all results are found and the first page displays the 10 rows but when i go to the next page no rows are displayed even though the totalRecords are showing that there are some.
I am quite new to php and thought i was doing so well but cannot get my head around what i´ve done wrong, all help appreciated. The code for the page is entered below, the error refer to the last 3 lines but i have put all the page there as i´m not sure what part on the code is casuing my problem with the next page not showing results.
Look forward to hearing from you.
  1. <?php require_once('Connections/propertypages.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7.  
  8. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  9.  
  10. switch ($theType) {
  11. case "text":
  12. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  13. break;
  14. case "long":
  15. case "int":
  16. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  17. break;
  18. case "double":
  19. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  20. break;
  21. case "date":
  22. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  23. break;
  24. case "defined":
  25. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  26. break;
  27. }
  28. return $theValue;
  29. }
  30. }
  31.  
  32. $currentPage = $_SERVER["PHP_SELF"];
  33.  
  34. $maxRows_RSsearchforsale = 10;
  35. $pageNum_RSsearchforsale = 0;
  36. if (isset($_GET['pageNum_RSsearchforsale'])) {
  37. $pageNum_RSsearchforsale = $_GET['pageNum_RSsearchforsale'];
  38. }
  39. $startRow_RSsearchforsale = $pageNum_RSsearchforsale * $maxRows_RSsearchforsale;
  40.  
  41. $varloc_RSsearchforsale = "-1";
  42. if (isset($_POST['location'])) {
  43. $varloc_RSsearchforsale = $_POST['location'];
  44. }
  45. $vartype_RSsearchforsale = "-1";
  46. if (isset($_POST['type'])) {
  47. $vartype_RSsearchforsale = $_POST['type'];
  48. }
  49. $varprice_RSsearchforsale = "-1";
  50. if (isset($_POST['price'])) {
  51. $varprice_RSsearchforsale = $_POST['price'];
  52. }
  53. $varbed_RSsearchforsale = "-1";
  54. if (isset($_POST['beds'])) {
  55. $varbed_RSsearchforsale = $_POST['beds'];
  56. }
  57. mysql_select_db($database_propertypages, $propertypages);
  58. $query_RSsearchforsale = sprintf("SELECT DISTINCT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid WHERE location=%s AND price=%s AND type=%s AND beds=%s ORDER BY detailstable.trueprice ASC", GetSQLValueString($varloc_RSsearchforsale, "text"),GetSQLValueString($varprice_RSsearchforsale, "text"),GetSQLValueString($vartype_RSsearchforsale, "text"),GetSQLValueString($varbed_RSsearchforsale, "text"));
  59. $query_limit_RSsearchforsale = sprintf("%s LIMIT %d, %d", $query_RSsearchforsale, $startRow_RSsearchforsale, $maxRows_RSsearchforsale);
  60. $RSsearchforsale = mysql_query($query_limit_RSsearchforsale, $propertypages) or die(mysql_error());
  61. $row_RSsearchforsale = mysql_fetch_assoc($RSsearchforsale);
  62.  
  63. if (isset($_GET['totalRows_RSsearchforsale'])) {
  64. $totalRows_RSsearchforsale = $_GET['totalRows_RSsearchforsale'];
  65. } else {
  66. $all_RSsearchforsale = mysql_query($query_RSsearchforsale);
  67. $totalRows_RSsearchforsale = mysql_num_rows($all_RSsearchforsale);
  68. }
  69. $totalPages_RSsearchforsale = ceil($totalRows_RSsearchforsale/$maxRows_RSsearchforsale)-1;
  70.  
  71.  
  72.  
  73. $maxRows_RsSearchForSale2 = 10;
  74. $pageNum_RsSearchForSale2 = 0;
  75. if (isset($_GET['pageNum_RsSearchForSale2'])) {
  76. $pageNum_RsSearchForSale2 = $_GET['pageNum_RsSearchForSale2'];
  77. }
  78. $startRow_RsSearchForSale2 = $pageNum_RsSearchForSale2 * $maxRows_RsSearchForSale2;
  79.  
  80.  
  81. $varloc2_RsSearchForSale2 = "-1";
  82. if (isset($_POST['location'])) {
  83. $varloc2_RsSearchForSale2 = $_POST['location'];
  84. }
  85. $varprice2_RsSearchForSale2 = "-1";
  86. if (isset($_POST['price'])) {
  87. $varprice2_RsSearchForSale2 = $_POST['price'];
  88. }
  89. $vartype2_RsSearchForSale2 = "-1";
  90. if (isset($_POST['type'])) {
  91. $vartype2_RsSearchForSale2 = $_POST['type'];
  92. }
  93. $varbed2_RsSearchForSale2 = "-1";
  94. if (isset($_POST['beds'])) {
  95. $varbed2_RsSearchForSale2 = $_POST['beds'];
  96. }
  97. switch (true) {
  98. case ($varloc2_RsSearchForSale2 == 'def'):
  99. case ($varprice2_RsSearchForSale2 == 'def'):
  100. case ($vartype2_RsSearchForSale2 == 'def'):
  101. case ($varbed2_RsSearchForSale2 == 'def'):
  102. mysql_select_db($database_propertypages, $propertypages);
  103. $query_RsSearchForSale2 = sprintf("SELECT DISTINCT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid WHERE (location=%s AND price=%s AND type=%s) OR (location=%s AND price=%s AND beds=%s) OR (location=%s AND type=%s AND beds=%s) OR (price=%s AND type=%s AND beds=%s) ORDER BY detailstable.trueprice ASC", GetSQLValueString($varloc2_RsSearchForSale2, "text"),GetSQLValueString($varprice2_RsSearchForSale2, "text"),GetSQLValueString($vartype2_RsSearchForSale2, "text"),GetSQLValueString($varloc2_RsSearchForSale2, "text"),GetSQLValueString($varprice2_RsSearchForSale2, "text"),GetSQLValueString($varbed2_RsSearchForSale2, "text"),GetSQLValueString($varloc2_RsSearchForSale2, "text"),GetSQLValueString($vartype2_RsSearchForSale2, "text"),GetSQLValueString($varbed2_RsSearchForSale2, "text"),GetSQLValueString($varprice2_RsSearchForSale2, "text"),GetSQLValueString($vartype2_RsSearchForSale2, "text"),GetSQLValueString($varbed2_RsSearchForSale2, "text"));
  104. $RsSearchForSale2 = mysql_query($query_RsSearchForSale2, $propertypages) or die(mysql_error());
  105. $row_RsSearchForSale2 = mysql_fetch_assoc($RsSearchForSale2);
  106. $totalRows_RsSearchForSale2 = mysql_num_rows($RsSearchForSale2);
  107. }
  108. $maxRows_RsSearchForSale3 = 10;
  109. $pageNum_RsSearchForSale3 = 0;
  110. if (isset($_GET['pageNum_RsSearchForSale3'])) {
  111. $pageNum_RsSearchForSale3 = $_GET['pageNum_RsSearchForSale3'];
  112. }
  113. $startRow_RsSearchForSale3 = $pageNum_RsSearchForSale3 * $maxRows_RsSearchForSale3;
  114.  
  115.  
  116.  
  117. $varloc3_RsSearchForSale3 = "-1";
  118. if (isset($_POST['location'])) {
  119. $varloc3_RsSearchForSale3 = $_POST['location'];
  120. }
  121. $varprice3_RsSearchForSale3 = "-1";
  122. if (isset($_POST['price'])) {
  123. $varprice3_RsSearchForSale3 = $_POST['price'];
  124. }
  125. $vartype3_RsSearchForSale3 = "-1";
  126. if (isset($_POST['type'])) {
  127. $vartype3_RsSearchForSale3 = $_POST['type'];
  128. }
  129. $varbed3_RsSearchForSale3 = "-1";
  130. if (isset($_POST['beds'])) {
  131. $varbed3_RsSearchForSale3 = $_POST['beds'];
  132. }
  133.  
  134. switch (true) {
  135. case ($varloc3_RsSearchForSale3 == 'def' && $varprice3_RsSearchForSale3 == 'def'):
  136. case ($varprice3_RsSearchForSale3 == 'def' && $vartype3_RsSearchForSale3 == 'def'):
  137. case ($vartype3_RsSearchForSale3 == 'def' && $varbed3_RsSearchForSale3 == 'def' ):
  138. case ($varbed3_RsSearchForSale3 == 'def' && $varloc3_RsSearchForSale3 == 'def'):
  139. case ($varloc3_RsSearchForSale3 == 'def' && $vartype3_RsSearchForSale3 == 'def'):
  140. case ($varprice3_RsSearchForSale3 == 'def' && $varbed3_RsSearchForSale3 == 'def'):
  141. mysql_select_db($database_propertypages, $propertypages);
  142. $query_RsSearchForSale3 = sprintf("SELECT DISTINCT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid WHERE (location=%s AND price=%s) OR (location=%s AND type=%s) OR (location=%s AND beds=%s) OR ( type=%s AND beds=%s) OR (price=%s AND type=%s) OR (price=%s AND beds=%s) ORDER BY detailstable.trueprice ASC", GetSQLValueString($varloc3_RsSearchForSale3, "text"),GetSQLValueString($varprice3_RsSearchForSale3, "text"),GetSQLValueString($varloc3_RsSearchForSale3, "text"),GetSQLValueString($vartype3_RsSearchForSale3, "text"),GetSQLValueString($varloc3_RsSearchForSale3, "text"),GetSQLValueString($varbed3_RsSearchForSale3, "text"),GetSQLValueString($vartype3_RsSearchForSale3, "text"),GetSQLValueString($varbed3_RsSearchForSale3, "text"),GetSQLValueString($varprice3_RsSearchForSale3, "text"),GetSQLValueString($vartype3_RsSearchForSale3, "text"),GetSQLValueString($varprice3_RsSearchForSale3, "text"),GetSQLValueString($varbed3_RsSearchForSale3, "text"));
  143. $RsSearchForSale3 = mysql_query($query_RsSearchForSale3, $propertypages) or die(mysql_error());
  144. $row_RsSearchForSale3 = mysql_fetch_assoc($RsSearchForSale3);
  145. $totalRows_RsSearchForSale3 = mysql_num_rows($RsSearchForSale3);
  146. }
  147. $maxRows_RsSearchForSale4 = 10;
  148. $pageNum_RsSearchForSale4 = 0;
  149. if (isset($_GET['pageNum_RsSearchForSale4'])) {
  150. $pageNum_RsSearchForSale4 = $_GET['pageNum_RsSearchForSale4'];
  151. }
  152. $startRow_RsSearchForSale4 = $pageNum_RsSearchForSale4 * $maxRows_RsSearchForSale4;
  153.  
  154.  
  155.  
  156. $varloc4_RsSearchForSale4 = "-1";
  157. if (isset($_POST['location'])) {
  158. $varloc4_RsSearchForSale4 = $_POST['location'];
  159. }
  160. $varprice4_RsSearchForSale4 = "-1";
  161. if (isset($_POST['price'])) {
  162. $varprice4_RsSearchForSale4 = $_POST['price'];
  163. }
  164. $vartype4_RsSearchForSale4 = "-1";
  165. if (isset($_POST['type'])) {
  166. $vartype4_RsSearchForSale4 = $_POST['type'];
  167. }
  168. $varbed4_RsSearchForSale4 = "-1";
  169. if (isset($_POST['beds'])) {
  170. $varbed4_RsSearchForSale4 = $_POST['beds'];
  171. }
  172. switch (true) {
  173. case ($varloc4_RsSearchForSale4 == 'def' && $vartype4_RsSearchForSale4 =='def' && $varprice4_RsSearchForSale4 == 'def'):
  174. case ($varloc4_RsSearchForSale4 == 'def' && $varprice4_RsSearchForSale4 =='def' && $varbed4_RsSearchForSale4 == 'def'):
  175. case ($varloc4_RsSearchForSale4 == 'def' && $varbed4_RsSearchForSale4 =='def' && $vartype4_RsSearchForSale4 == 'def'):
  176. case ($varbed4_RsSearchForSale4 == 'def' && $vartype4_RsSearchForSale4 =='def' && $varprice4_RsSearchForSale4 == 'def'):
  177. mysql_select_db($database_propertypages, $propertypages);
  178. $query_RsSearchForSale4 = sprintf("SELECT DISTINCT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid WHERE location=%s OR price=%s OR type=%s OR beds=%s ORDER BY detailstable.trueprice ASC", GetSQLValueString($varloc4_RsSearchForSale4, "text"),GetSQLValueString($varprice4_RsSearchForSale4, "text"),GetSQLValueString($vartype4_RsSearchForSale4, "text"),GetSQLValueString($varbed4_RsSearchForSale4, "text"));
  179. $RsSearchForSale4 = mysql_query($query_RsSearchForSale4, $propertypages) or die(mysql_error());
  180. $row_RsSearchForSale4 = mysql_fetch_assoc($RsSearchForSale4);
  181. $totalRows_RsSearchForSale4 = mysql_num_rows($RsSearchForSale4);
  182. }
  183. $queryString_RSsearchforsale = "";
  184. if (!empty($_SERVER['QUERY_STRING'])) {
  185. $params = explode("&", $_SERVER['QUERY_STRING']);
  186. $newParams = array();
  187. foreach ($params as $param) {
  188. if (stristr($param, "pageNum_RSsearchforsale") == false &&
  189. stristr($param, "totalRows_RSsearchforsale") == false) {
  190. array_push($newParams, $param);
  191. }
  192. }
  193. if (count($newParams) != 0) {
  194. $queryString_RSsearchforsale = "&" . htmlentities(implode("&", $newParams));
  195. }
  196. }
  197. $queryString_RSsearchforsale = sprintf("&totalRows_RSsearchforsale=%d%s", $totalRows_RSsearchforsale, $queryString_RSsearchforsale);
  198. ?>
  1. <p>&nbsp;</p>
  2. <div id="mainContent">
  3. <?php if ($totalRows_RSsearchforsale > 0 )
  4. { // Show if recordset not empty ?>
  5. <p class="records">SEARCH RESULTS</p>
  6. <p class="records">Found <?php echo $totalRows_RSsearchforsale ?></p>
  7. <p class="Propertiesright">Properties <?php echo ($startRow_RSsearchforsale + 1) ?> to <?php echo min($startRow_RSsearchforsale + $maxRows_RSsearchforsale, $totalRows_RSsearchforsale) ?></p>
  8. <p>&nbsp;</p>
  9. <p>&nbsp;</p>
  10. <?php do { ?>
  11. <div id="salesresults">
  12. <p><img src="PhotosResults/<?php echo $row_RSsearchforsale['photo1']; ?>" alt="Photo Property For Sale" class="imageleft" /><span class="pararightloc"><?php echo $row_RSsearchforsale['loc']; ?></span><span class="price"><?php echo $row_RSsearchforsale['trueprice']; ?> €</span></p>
  13. <div id="topborder">
  14. <p><span class="location"><?php echo $row_RSsearchforsale['style']; ?></span><span class="lineheight"><?php echo $row_RSsearchforsale['number']; ?> Beds</span> <span class="space"><?php echo $row_RSsearchforsale['bathrooms']; ?>Baths </span></p>
  15. </div>
  16. <p>&nbsp;</p>
  17. <p>Ref : <?php echo $row_RSsearchforsale['propid']; ?></p>
  18. <p>&nbsp;</p>
  19. <p><?php echo $row_RSsearchforsale['desc']; ?></p>
  20. <p>&nbsp;</p>
  21. <p>&nbsp;</p>
  22. <p><span class="space"><a href="detailsForSale.php?propid=<?php echo $row_RSsearchforsale['propid']; ?>" class="moreinfo">More Info</a></span> </p>
  23. <p>&nbsp;</p>
  24. </div>
  25. <?php } while ($row_RSsearchforsale = mysql_fetch_assoc($RSsearchforsale)); ?><p>&nbsp;
  26. <div id="navigate">
  27. <span class="records">Page Navigation</span>
  28. <table border="0" class="centralise">
  29. <tr>
  30. <td><?php if ($pageNum_RSsearchforsale > 0) { // Show if not first page ?>
  31. <a href="<?php printf("%s?pageNum_RSsearchforsale=%d%s", $currentPage, 0, $queryString_RSsearchforsale); ?>">First</a>
  32. <?php } // Show if not first page ?> </td>
  33. <td><?php if ($pageNum_RSsearchforsale > 0) { // Show if not first page ?>
  34. <a href="<?php printf("%s?pageNum_RSsearchforsale=%d%s", $currentPage, max(0, $pageNum_RSsearchforsale - 1), $queryString_RSsearchforsale); ?>">Previous</a>
  35. <?php } // Show if not first page ?> </td>
  36. <td><?php if ($pageNum_RSsearchforsale < $totalPages_RSsearchforsale) { // Show if not last page ?>
  37. <a href="<?php printf("%s?pageNum_RSsearchforsale=%d%s", $currentPage, min($totalPages_RSsearchforsale, $pageNum_RSsearchforsale + 1), $queryString_RSsearchforsale); ?>">Next</a>
  38. <?php } // Show if not last page ?> </td>
  39. <td><?php if ($pageNum_RSsearchforsale < $totalPages_RSsearchforsale) { // Show if not last page ?>
  40. <a href="<?php printf("%s?pageNum_RSsearchforsale=%d%s", $currentPage, $totalPages_RSsearchforsale, $queryString_RSsearchforsale); ?>">Last</a>
  41. <?php } // Show if not last page ?> </td>
  42. </tr>
  43. </table>
  44. </div>
  45. <?php } elseif ($totalRows_RsSearchForSale2 > 0 ) { // Show if recordset not empty ?>
  46. <p class="records">SEARCH RESULTS</p>
  47. <p class="records">Found <?php echo $totalRows_RsSearchForSale2 ?></p>
  48. <p class="Propertiesright">Properties <?php echo ($startRow_RsSearchForSale2 + 1) ?> to <?php echo min($startRow_RsSearchForSale2 + $maxRows_RsSearchForSale2, $totalRows_RsSearchForSale2) ?></p>
  49. <p>&nbsp;</p>
  50. <p>&nbsp;</p>
  51. <?php do { ?>
  52. <div id="salesresults">
  53. <p><img src="PhotosResults/<?php echo $row_RsSearchForSale2['photo1']; ?>" alt="Photo Property For Sale" class="imageleft" /><span class="pararightloc"><?php echo $row_RsSearchForSale2['loc']; ?></span><span class="price"><?php echo $row_RsSearchForSale2['trueprice']; ?> €</span></p>
  54. <div id="topborder">
  55. <p><span class="location"><?php echo $row_RsSearchForSale2['style']; ?></span><span class="lineheight"><?php echo $row_RsSearchForSale2['number']; ?> Beds</span> <span class="space"><?php echo $row_RsSearchForSale2['bathrooms']; ?>Baths </span></p>
  56. </div>
  57. <p>&nbsp;</p>
  58. <p>Ref : <?php echo $row_RsSearchForSale2['propid']; ?></p>
  59. <p>&nbsp;</p>
  60. <p><?php echo $row_RsSearchForSale2['desc']; ?></p>
  61. <p>&nbsp;</p>
  62. <p>&nbsp;</p>
  63. <p><span class="space"><a href="detailsForSale.php?propid=<?php echo $row_RsSearchForSale2['propid']; ?>" class="moreinfo">More Info</a></span> </p>
  64. <p>&nbsp;</p>
  65. </div>
  66. <?php } while ($row_RsSearchForSale2 = mysql_fetch_assoc($RsSearchForSale2)); ?><p>&nbsp;
  67. <div id="navigate">
  68. <span class="records">Page Navigation</span>
  69. <table border="0" class="centralise">
  70. <tr>
  71. <td><?php if ($pageNum_RsSearchForSale2 > 0) { // Show if not first page ?>
  72. <a href="<?php printf("%s?pageNum_RsSearchForSale2=%d%s", $currentPage, 0, $queryString_RsSearchForSale2); ?>">First</a>
  73. <?php } // Show if not first page ?> </td>
  74. <td><?php if ($pageNum_RsSearchForSale2 > 0) { // Show if not first page ?>
  75. <a href="<?php printf("%s?pageNum_RsSearchForSale2=%d%s", $currentPage, max(0, $pageNum_RsSearchForSale2 - 1), $queryString_RsSearchForSale2); ?>">Previous</a>
  76. <?php } // Show if not first page ?> </td>
  77. <td><?php if ($pageNum_RsSearchForSale2 < $totalPages_RsSearchForSale2) { // Show if not last page ?>
  78. <a href="<?php printf("%s?pageNum_RsSearchForSale2=%d%s", $currentPage, min($totalPages_RsSearchForSale2, $pageNum_RsSearchForSale2 + 1), $queryString_RsSearchForSale2); ?>">Next</a>
  79. <?php } // Show if not last page ?> </td>
  80. <td><?php if ($pageNum_RsSearchForSale2 < $totalPages_RsSearchForSale2) { // Show if not last page ?>
  81. <a href="<?php printf("%s?pageNum_RsSearchForSale2=%d%s", $currentPage, $totalPages_RsSearchForSale2, $queryString_RsSearchForSale2); ?>">Last</a>
  82. <?php } // Show if not last page ?> </td>
  83. </tr>
  84. </table>
  85. </div>
  86. <?php } elseif ($totalRows_RsSearchForSale3 > 0 ) { // Show if recordset not empty ?>
  87. <p class="records">SEARCH RESULTS</p>
  88. <p class="records">Found <?php echo $totalRows_RsSearchForSale3 ?></p>
  89. <p class="Propertiesright">Properties <?php echo ($startRow_RsSearchForSale3 + 1) ?> to <?php echo min($startRow_RsSearchForSale3 + $maxRows_RsSearchForSale3, $totalRows_RsSearchForSale3) ?></p>
  90. <p>&nbsp;</p>
  91. <p>&nbsp;</p>
  92. <?php do { ?>
  93. <div id="salesresults">
  94. <p><img src="PhotosResults/<?php echo $row_RsSearchForSale3['photo1']; ?>" alt="Photo Property For Sale" class="imageleft" /><span class="pararightloc"><?php echo $row_RsSearchForSale3['loc']; ?></span><span class="price"><?php echo $row_RsSearchForSale3['trueprice']; ?> €</span></p>
  95. <div id="topborder">
  96. <p><span class="location"><?php echo $row_RsSearchForSale3['style']; ?></span><span class="lineheight"><?php echo $row_RsSearchForSale3['number']; ?> Beds</span> <span class="space"><?php echo $row_RsSearchForSale3['bathrooms']; ?>Baths </span></p>
  97. </div>
  98. <p>&nbsp;</p>
  99. <p>Ref : <?php echo $row_RsSearchForSale3['propid']; ?></p>
  100. <p>&nbsp;</p>
  101. <p><?php echo $row_RsSearchForSale3['desc']; ?></p>
  102. <p>&nbsp;</p>
  103. <p>&nbsp;</p>
  104. <p><span class="space"><a href="detailsForSale.php?propid=<?php echo $row_RsSearchForSale3['propid']; ?>" class="moreinfo">More Info</a></span> </p>
  105. <p>&nbsp;</p>
  106. </div>
  107. <?php } while ($row_RsSearchForSale3 = mysql_fetch_assoc($RsSearchForSale3)); ?><p>&nbsp;
  108. <div id="navigate">
  109. <span class="records">Page Navigation</span>
  110. <table border="0" class="centralise">
  111. <tr>
  112. <td><?php if ($pageNum_RsSearchForSale3 > 0) { // Show if not first page ?>
  113. <a href="<?php printf("%s?pageNum_RsSearchForSale3=%d%s", $currentPage, 0, $queryString_RsSearchForSale3); ?>">First</a>
  114. <?php } // Show if not first page ?> </td>
  115. <td><?php if ($pageNum_RsSearchForSale3 > 0) { // Show if not first page ?>
  116. <a href="<?php printf("%s?pageNum_RsSearchForSale3=%d%s", $currentPage, max(0, $pageNum_RsSearchForSale3 - 1), $queryString_RsSearchForSale3); ?>">Previous</a>
  117. <?php } // Show if not first page ?> </td>
  118. <td><?php if ($pageNum_RsSearchForSale3 < $totalPages_RsSearchForSale3) { // Show if not last page ?>
  119. <a href="<?php printf("%s?pageNum_RsSearchForSale3=%d%s", $currentPage, min($totalPages_RsSearchForSale3, $pageNum_RsSearchForSale3 + 1), $queryString_RsSearchForSale3); ?>">Next</a>
  120. <?php } // Show if not last page ?> </td>
  121. <td><?php if ($pageNum_RsSearchForSale3 < $totalPages_RsSearchForSale3) { // Show if not last page ?>
  122. <a href="<?php printf("%s?pageNum_RsSearchForSale3=%d%s", $currentPage, $totalPages_RsSearchForSale3, $queryString_RsSearchForSale3); ?>">Last</a>
  123. <?php } // Show if not last page ?> </td>
  124. </tr>
  125. </table>
  126. </div>
  127. <?php } elseif ($totalRows_RsSearchForSale4 > 0 ) { // Show if recordset not empty ?>
  128. <p class="records">SEARCH RESULTS</p>
  129. <p class="records">Found <?php echo $totalRows_RsSearchForSale4 ?></p>
  130. <p class="Propertiesright">Properties <?php echo ($startRow_RsSearchForSale4 + 1) ?> to <?php echo min($startRow_RsSearchForSale4 + $maxRows_RsSearchForSale4, $totalRows_RsSearchForSale4) ?></p>
  131. <p>&nbsp;</p>
  132. <p>&nbsp;</p>
  133. <?php do { ?>
  134. <div id="salesresults">
  135. <p><img src="PhotosResults/<?php echo $row_RsSearchForSale4['photo1']; ?>" alt="Photo Property For Sale" class="imageleft" /><span class="pararightloc"><?php echo $row_RsSearchForSale4['loc']; ?></span><span class="price"><?php echo $row_RsSearchForSale4['trueprice']; ?> €</span></p>
  136. <div id="topborder">
  137. <p><span class="location"><?php echo $row_RsSearchForSale4['style']; ?></span><span class="lineheight"><?php echo $row_RsSearchForSale4['number']; ?> Beds</span> <span class="space"><?php echo $row_RsSearchForSale4['bathrooms']; ?>Baths </span></p>
  138. </div>
  139. <p>&nbsp;</p>
  140. <p>Ref : <?php echo $row_RsSearchForSale4['propid']; ?></p>
  141. <p>&nbsp;</p>
  142. <p><?php echo $row_RsSearchForSale4['desc']; ?></p>
  143. <p>&nbsp;</p>
  144. <p>&nbsp;</p>
  145. <p><span class="space"><a href="detailsForSale.php?propid=<?php echo $row_RsSearchForSale4['propid']; ?>" class="moreinfo">More Info</a></span> </p>
  146. <p>&nbsp;</p>
  147. </div>
  148. <?php } while ($row_RsSearchForSale4 = mysql_fetch_assoc($RsSearchForSale4)); ?><p>&nbsp;
  149. <div id="navigate">
  150. <span class="records">Page Navigation</span>
  151. <table border="0" class="centralise">
  152. <tr>
  153. <td><?php if ($pageNum_RsSearchForSale4 > 0) { // Show if not first page ?>
  154. <a href="<?php printf("%s?pageNum_RsSearchForSale4=%d%s", $currentPage, 0, $queryString_RsSearchForSale4); ?>">First</a>
  155. <?php } // Show if not first page ?> </td>
  156. <td><?php if ($pageNum_RsSearchForSale4 > 0) { // Show if not first page ?>
  157. <a href="<?php printf("%s?pageNum_RsSearchForSale4=%d%s", $currentPage, max(0, $pageNum_RsSearchForSale4 - 1), $queryString_RsSearchForSale4); ?>">Previous</a>
  158. <?php } // Show if not first page ?> </td>
  159. <td><?php if ($pageNum_RsSearchForSale4 < $totalPages_RsSearchForSale4) { // Show if not last page ?>
  160. <a href="<?php printf("%s?pageNum_RsSearchForSale4=%d%s", $currentPage, min($totalPages_RsSearchForSale4, $pageNum_RsSearchForSale4 + 1), $queryString_RsSearchForSale4); ?>">Next</a>
  161. <?php } // Show if not last page ?> </td>
  162. <td><?php if ($pageNum_RsSearchForSale4 < $totalPages_RsSearchForSale4) { // Show if not last page ?>
  163. <a href="<?php printf("%s?pageNum_RsSearchForSale4=%d%s", $currentPage, $totalPages_RsSearchForSale4, $queryString_RsSearchForSale4); ?>">Last</a>
  164. <?php } // Show if not last page ?> </td>
  165. </tr>
  166. </table>
  167. </div>
  168. <?php } elseif (totalRows_RSsearchforsale == 0 || totalRows_RsSearchForSale2 == 0 || totalRows_RsSearchForSale3 == 0 ||totalRows_RsSearchForSale4 == 0 ) { // No results?>
  169. <div id="noResults">
  170. <p>There were no results found for your search. </p>
  171. <p>Please try again with new criteria.</p>
  172. <p>&nbsp;</p>
  173. </div>
  174. <?php } // End No results ?>
  175.  
  176. </div>
  177. <?php
  178. mysql_free_result($RSsearchforsale);
  179.  
  180. mysql_free_result($RsSearchForSale2);
  181.  
  182. mysql_free_result($RsSearchForSale3);
  183.  
  184. mysql_free_result($RsSearchForSale4);
  185. ?>
Thank you in advance for any response, and sorry about all the code.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 607
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 70
network18 network18 is offline Offline
Practically a Master Poster
 
0
  #2
Oct 31st, 2009
describing your problem precisely and with short code, help to diagnose the problem quickly.
your php tags never ends in above code, almost all the closing tags hide behind the comment.
like -
<?php echo "=>".$test; //this is comment ?>
Last edited by network18; Oct 31st, 2009 at 3:09 am.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum


Views: 295 | Replies: 1
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC