By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,885 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

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

P: n/a
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(point,html, label) {
var html = '<div style="width: 300px;height:
175px">' + html + '</div>';
var marker = new GMarker(point, icon);
GEvent.addListener(marker, "click", function() {
//make view default map because sometimes don't
have sattelite images
map.setMapType(G_MAP_TYPE);
map.centerAndZoom(point,3);
marker.openInfoWindowHtml(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="javascript:myclick(' + i + ')">' + '<img
src="http://labs.google.com/ridefinder/images/mm_20_red.png">' + label
+ '</a><br>';

i++;
return marker;

}

Jun 24 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rik
ho***********@gmail.com wrote:
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
."';


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
Jun 24 '06 #2

P: n/a
sure the code is this

$query = "SELECT * FROM homepricemaps where salesdate >= '" . $date2
.."' AND salesdate <= '" . $date1."' AND citystate = '" . $input ."'
order by address ";
$result=mysql_query($query);
while($row = mysql_fetch_array($result))
{

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

$row['zipcodes'] . "<br>Sqft:" . $row['squarefeet']
.. "<br>Sales Date: " . $row['salesdate'] . "<br>Year Built: " .
$row['yearbuilt'] . "<br>Bedrooms: " . $row['bedrooms'] ."<br>" .
$mortgagecalculator ."<br>" . $homelisturl . "<br>" . $mortgagequotes .
"<br>" . $realtorlist . "<br>"."','" . $row['address'] . "
".$row['city']." ".$row['state']."');\n";
echo "map.addOverlay(marker);\n";

}

Jun 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.