//number of columns displayed $numcolumns=5; //database connection variables $countryNum=$_GET['countryid']; //echo 'country id is: '; //echo $countryNum; $label=array(); $label[1]=""; $label[2]=""; $label[3]=""; $label[4]=""; $label[5]=""; $label[6]=""; $column=1; include 'php/databaseconnect.php'; $sql10='SELECT * from country where country_id='; $sql11=$sql10.$countryNum; //echo 'sql11 is: '; //echo $sql11; $result2 = @mysqli_query($conn,$sql11); $row2 = mysqli_fetch_row($result2); $countrynoparen = $row2[1]; //echo 'The country countrynoparen is: '; //echo $countrynoparen; echo '
'; echo ' | '; echo''; echo' | '; echo ''; echo ' | '; echo'
'; echo $row[5]; echo ' | ';
echo '
'; echo $label[1]; echo ' | ';
echo ''; echo $label[2]; echo ' | ';
echo ''; echo $label[3]; echo ' | ';
echo ''; echo $label[4]; echo ' | ';
echo ''; echo $label[5]; echo ' | ';
$label[1]="";
$label[2]="";
$label[3]="";
$label[4]="";
$label[5]="";
echo '
'; echo $row[5]; echo ' | ';
echo '
'; echo $label[1]; echo ' | ';
echo ''; echo $label[2]; echo ' | ';
echo ''; echo $label[3]; echo ' | ';
echo ''; echo $label[4]; echo ' | ';
echo ''; echo $label[5]; echo ' | ';
echo '
'; echo ''; echo ' | '; $label[$column]=$row[3]; $column=$column+1; //end of loop } //ends the current row and starts a row for the last labels echo '||||
';
echo ''; echo $label[$counter]; echo ' | ';
$counter=$counter+1;
}
//Update views in database
$sql80='SELECT * from country where country_id=';
$sql81=$sql80.$countryNum;
//echo $sql81;
$result82 = @mysqli_query($conn,$sql81);
$row82 = mysqli_fetch_row($result82);
$views = $row82[5]+1;
//echo $views;
$sql40='UPDATE country SET views=';
$sql41=' WHERE country_id=';
$update_views_query=$sql40.$views.$sql41.$countryNum;
//echo $update_views_query;
mysqli_query($conn,$update_views_query);
//closes the database connection
mysqli_close($conn);
?>