combining PHP and javascript, beginner's frustration
Posted: Sun Feb 22, 2009 1:05 pm
so i'm new to php, and I'm working on an assignment for class, here is my problem
i grab items from a database, lat and lng are varchar, type, owner, and desc are char
then later on down the road I want to call a function that passes the items that i grabbed from the database
the $counter variable isn't getting incremented, it just stays at zero, any ideas
i grab items from a database, lat and lng are varchar, type, owner, and desc are char
Code: Select all
while($row = mysql_fetch_array($result,MYSQLI_ASSOC)){
$markers[$counter] = array( $row['lat'], $row['lng'] , $row['type'] , $row['owner'] , $row['desc'] );
$counter++;
} //end while
Code: Select all
<?php $counter = 0; ?>
for(i = 0; i < 3; i++){
addMarker(<?php echo $markers[$counter][0] ?>, <?php echo $band[$counter][1] ?> ,<?php echo $band[$counter][2] ?>, <?php echo $band[$counter][3] ?> , <?php echo $band[$counter][4] ?>);
<?php $counter++; ?> //counter starts off at 0 and is initialized someone else
}