php returns 9 records instead of 10 when i do a select *

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • homepricemaps@gmail.com

    php returns 9 records instead of 10 when i do a select *

    i run a mapping website at http://www.HomePriceMaps.com which maps real
    estate prices however i have found that when i do select * where there
    are 10 records found in the db that for some reason only 9 are returned
    to the user. If there are only 2 records found in the db than only 1
    is returned.

    my php code looks like this and i cannot tell if its the logic of my
    php code or perhaps my javascript:

    php code

    $query = "SELECT * FROM homepricemaps where citystate = '" . $input
    .."';


    javascript function

    // A function to create the marker and set up
    the event window
    function createMarker(po int,html, label) {
    var html = '<div style="width: 300px;height:
    175px">' + html + '</div>';
    var marker = new GMarker(point, icon);
    GEvent.addListe ner(marker, "click", function() {
    //make view default map because sometimes don't
    have sattelite images
    map.setMapType( G_MAP_TYPE);
    map.centerAndZo om(point,3);
    marker.openInfo WindowHtml(html );
    });
    // save the info we need to use later for
    the sidebar
    gmarkers[i] = marker;
    htmls[i] = html;
    // add a line to the sidebar html
    sidebar_html += '<a
    href="javascrip t:myclick(' + i + ')">' + '<img
    src="http://labs.google.com/ridefinder/images/mm_20_red.png"> ' + label
    + '</a><br>';

    i++;


    return marker;

    }

  • Rik

    #2
    Re: php returns 9 records instead of 10 when i do a select *

    homepricemaps@g mail.com wrote:[color=blue]
    > i run a mapping website at http://www.HomePriceMaps.com which maps
    > real estate prices however i have found that when i do select * where
    > there are 10 records found in the db that for some reason only 9 are
    > returned to the user. If there are only 2 records found in the db
    > than only 1 is returned.
    >
    > my php code looks like this and i cannot tell if its the logic of my
    > php code or perhaps my javascript:
    >
    > php code
    >
    > $query = "SELECT * FROM homepricemaps where citystate = '" . $input
    > ."';[/color]

    This code won't return anything.
    Please post the the total portion of the code in which you extract records
    from the database.

    Grtz,
    --
    Rik Wasmus


    Comment

    • homepricemaps@gmail.com

      #3
      Re: php returns 9 records instead of 10 when i do a select *

      sure the code is this

      $query = "SELECT * FROM homepricemaps where salesdate >= '" . $date2
      .."' AND salesdate <= '" . $date1."' AND citystate = '" . $input ."'
      order by address ";


      $result=mysql_q uery($query);
      while($row = mysql_fetch_arr ay($result))
      {

      echo "var point = new GPoint(" . $row['lon'] . ","
      .. $row['lat'] . ");\n";
      echo "var marker = createMarker(po int, 'Address: ".
      $row['address'] . " ".$row['city']." ".$row['state']."<br>Sale Price:
      $". $row['salesprice'] . "<br>Zipcod e: " .

      $row['zipcodes'] . "<br>Sqft:" . $row['squarefeet']
      .. "<br>Sales Date: " . $row['salesdate'] . "<br>Year Built: " .
      $row['yearbuilt'] . "<br>Bedroo ms: " . $row['bedrooms'] ."<br>" .
      $mortgagecalcul ator ."<br>" . $homelisturl . "<br>" . $mortgagequotes .
      "<br>" . $realtorlist . "<br>"."',' " . $row['address'] . "
      ".$row['city']." ".$row['state']."');\n";


      echo "map.addOverlay (marker);\n";



      }

      Comment

      Working...