I get the following error "syntax error, unexpected '$records1' (T_VARIABLE)" if I put the if line in my code. Why? I don't understand it.
<?php
$continent = $_GET['continent'];
if (!empty($continent)
{
$records1 = mysqli_query($link, "SELECT name, capital From country where continent='$continent'");
while ($data1 = mysqli_fetch_array($records1))
{
$nume=$data1['name'];
$capitala=$data1['capital'];
echo '<br>'.'<br>';
echo 'Tara'.' '.$nume.' are capitala '.$capitala.'.';
}
}
?>