I wrote this code for a translation table which I use inside my dictionary website.
<div class="row">
<?php
$stmt_word1 = $auth_user->runQuery("SELECT * FROM word_language_meanings WHERE word_id = '".$word_id."'");
$stmt_word1->execute();
$wordLangRows=$stmt_word1->fetchAll(PDO::FETCH_ASSOC);
$counter = 1;
foreach($wordLangRows as $k => $v)
{
if($v['word_language'] != $language)
{
?>
<div class="col-sm-4 black_color" id="col-sm-4-translations">
<h5><strong><?php echo $v['word_language']; ?></strong></h5>
<span class="<?php if($v['word_language'] == 'Старобългарски') { echo 'bulgarian_font'; } ?>"><a style="color: gray;" href="dictionary.php?meaning=<?php echo $v['word_meaning']; ?>&language=<?php echo $word_language; ?>"><?php echo $v['word_meaning']; ?></a></span>
</div>
<?php
}
}
?>
</div>
Unfortunately the code below does not redirect me to the particular word I'd choose from the translation table.
<span class="<?php if($v['word_language'] == 'Старобългарски') { echo 'bulgarian_font'; } ?>"><a style="color: gray;" href="dictionary.php?meaning=<?php echo $v['word_meaning']; ?>&language=<?php echo $word_language; ?>"><?php echo $v['word_meaning']; ?></a></span>
It shows me this url but as u can see the language is not defined. What I am trying to do is to tell, if the word is for example "test" and its an english translation, to redirect me to that word of that particular language, as it's set in the database. Has anyone any idea how to make this work?
</div>