I got this simple code:
$x = 1999;
while($x != 1949)
{
echo '<option value="' $x '">' $x '</option>';
$x = $x - 1;
}
But the page isn't loading any more with this code, what's wrong with it?
I got this simple code:
$x = 1999;
while($x != 1949)
{
echo '<option value="' $x '">' $x '</option>';
$x = $x - 1;
}
But the page isn't loading any more with this code, what's wrong with it?
You need to concatenate your variables: (notice the dots in your echo)
$x = 1999;
while($x != 1949)
{
echo '<option value="'.$x.'">'.$x.'</option>';
$x = $x - 1;
}
try this
$x = 1999;
while($x != 1949)
{
echo '<option value="'. $x .'">'. $x .'</option>';
$x = $x - 1;
}
Try
$x = 1999;
while($x != 1949)
{
echo '<option value="'.$x .'">'. $x. '</option>';
$x--;
}