<?php
function findShortCodeAndLang($short_name, $lang)
{
global $conn;
$sql = "SELECT * FROM bb_ads WHERE short_code = '$short_name' AND lang = '$lang' ";
$conn->set_charset('utf-8');
$result = $conn->query($sql);
$row = $result->fetch_all(MYSQLI_ASSOC);
if(empty($row) || empty($row[0))) return 'not found';
return $row[0]['text'];
}
$lang = '';
if ((isset($_GET['language']) && $_GET['language'] == 'en') || !isset($_GET['language'])) {
$lang = 'en';
} else {
$lang = 'pl';
}
?>
<a href class="btn__color"><?php echo findShortCodeAndLang('BUTTON_PORTFOLIO', $lang) ?></a>