My Php/mySQL code for creating google maps markers is printing out "Array" instead of the zip codes I would like it to print. So instead of three different markers at three different locations I get three markers on Array Road in Cassville, Missouri. Here is my code
$result = mysql_query("SELECT fldZip FROM tblLocation")
or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print "codeAddress(\"$row\");";
}
?>
Can anyone help me out with this? If you need more of my code let me know, I have a feeling the error is somewhere here however.
Thanks,
Wakeeta
Try
printf( "codeAddress(\"%s\")", $row['fldZip'] );
I'm not sure what's unclear...
$row = mysql_fetch_array($result)
is assigning an array to the variable $row
So, to access individual members of the $row
array you'll need their keys, e.g.:
$row["fldZip"]
use $row['fldZip'] to retreive the value.