Hallo,
ich habe ein Problem mit globalen variablen,
Beispiel:
PHP-Code:
function smiliesdb()
{
global $trpc_parameters_smilies;
$trpc_name_s;
$trpc_value_s;
// Get smilies from db
if($trpc_result_smilies = @mysql_query("SELECT name, value FROM $TAB_parameters_smilies"))
{
while ($trpc_a_smilies = mysql_fetch_array($trpc_result_smilies))
{
$trpc_name_s = $trpc_a_smilies["name"];
$trpc_value_s = $trpc_a_smilies["value"];
$trpc_parameters_smilies[$trpc_name_s] = $trpc_value_s;
}
}
}
funktioniert beim start ohne fehler, nur steht die Variable $trpc_parameters_smilies[$trpc_name_s] nicht zur verfühgung, schreibe ich das ganze anders...
Beispiel:
PHP-Code:
function smiliesdb()
{
global $trpc_parameters_smilies[$trpc_name_s];
$trpc_name_s;
$trpc_value_s;
// Get smilies from db
if($trpc_result_smilies = @mysql_query("SELECT name, value FROM $TAB_parameters_smilies"))
{
while ($trpc_a_smilies = mysql_fetch_array($trpc_result_smilies))
{
$trpc_name_s = $trpc_a_smilies["name"];
$trpc_value_s = $trpc_a_smilies["value"];
$trpc_parameters_smilies[$trpc_name_s] = $trpc_value_s;
}
}
}
gibt es eine fehlermeldung:
Parse error: parse error, expecting `','' or `';'' functions.inc.php on line xx und zwar in der zeile wo die variable $trpc_parameters_smilies[$trpc_name_s]; steht.