I have the following function which pulls an entire row into an array but what I would like to do is use the row titles of en,de,es,fr,it in the array like me examples at the bottom
function translateWord($word,$lang){
$result = mysql_query("SELECT * FROM tbl_translate WHERE en = '$word'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);
print_r($row);
}
translateWord('hi','fr');
response
1 [1] => hi [2] => hallo [3] => hola [4] => bonjour [5] => ciao )
Needs to be
1 [en] => hi [de] => hallo [es] => hola [fr] => bonjour [it] => ciao )
$row = mysql_fetch_assoc($result);
print_r($row);
[en] => hi [de] => hallo [es] => hola [fr] => bonjour [it] => ciao )