Hallo,
ich habe eine MySQL-Tabelle mit Konfigurationen (spalte setting, spalte value).
Ich habe folgende Funktion, die die Konfigurationswerte auslesen soll:
In der Datei, wo ich auf die config zugreifen will, mache ich noch
Leider steht in der JS-Variable tgebuehr nichts drin, obwohl der Wert "prs_jgd_tagungsgebuehr" in der Tabelle einen Wert hat.
Wo liegt mein Denkfehler?
ich habe eine MySQL-Tabelle mit Konfigurationen (spalte setting, spalte value).
Ich habe folgende Funktion, die die Konfigurationswerte auslesen soll:
PHP-Code:
function anm_get_config()
{
static $config;
global $prefix;
if( $config == TRUE )
{
return $config;
}
$result = mysql_query(sprintf("SELECT * FROM `%sforums`",$prefix));
var_dump ($result);
$config = mysql_fetch_array($result, MYSQL_ASSOC);
return $config;
}
PHP-Code:
$_ANM_CONFIG = anm_get_config();
...
<script>
var tgebuehr = <?php sprintf($_ANM_CONFIG['prs_jgd_tagungsgebuehr']) ?>
</script>
Wo liegt mein Denkfehler?
Kommentar