I am trying to make a dynamic division that changes its id with a variables. In addition to this, the dvision is a popup. The division has to be unique, since I am pulling info from a database. What I have so far is this:
<?php
$index_map = 4; //this variable is already defined in other part of the document.
//It is just here to specify its value to the readers
$index_data = 1;
while($index_data = $index_map)
{
echo '
<div data-role="popup" id="mapdata'.$index_data.'" class="ui-content" data-theme="d">
<img class="popphoto" src="style/2nd_floor.png"
style="max-height:512px;" alt="Parking_Lot_Map1">
'.$index_data.'
</div>
';
$index_data++;
}
?>
For some reason the while loops does not do anything, and does not display any other html data after that. This is a PHP document that is included in another .php file. I dont why the while loop does no recognize the variables
$index_data == $index_map
double equals – Justin Bicknell Jun 7 at 20:33$index_data
is always going to be set to a value of4
at each iteration. Since4
will evaluate as truthy, you will have an endless loop. – Mike Brant Jun 7 at 20:37