MyBB Community Forums

Full Version: my way of language files in a database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to write a system that uses a database for languages

<?php
require "./global.php";

define("KILL_GLOBALS", 1);

//load languages
$lang_name = "test";

function lang($lang_title)
{	
	global $db, $l, $lang_name;
	
	$query = $db->query("SELECT * FROM ".TABLE_PREFIX."languages WHERE name='$lang_name' && title='$lang_title'");
    $l = $db->fetch_array($query);
}


lang(testing);
echo "<b>{$l['text']}</b>";

?>

it's not well designed but it works