This topic is locked

Custom Data in locale.php, called from database

10/19/2010 9:49:24 PM
PHPRunner General questions
localleadmachines author

Have a bit of an issue trying to get PHP Runner to accept a connection so i an pull data from a database into the local variables.
I need to populate the SCURRENCY with a dollar sign or pound sign. I can already change the data dynamically from my admin. Just cant get it into the locale.php file without a ton of header errors when i try to call my database connection file.
include("../../../inc/dbconnect.php");

$query = mysql_query("SELECT * FROM admin WHERE(id='1')");

$admin = mysql_fetch_array($query);
$locale_info["LOCALE_ICURRDIGITS"]="2";

$locale_info["LOCALE_ICURRENCY"]="0";

$locale_info["LOCALE_INEGCURR"]="0";

$locale_info["LOCALE_SCURRENCY"]=$admin['rate2'];

$locale_info["LOCALE_SMONDECIMALSEP"]=".";

$locale_info["LOCALE_SMONGROUPING"]="3;0";

$locale_info["LOCALE_SMONTHOUSANDSEP"]=",";
Have my Lead Generation Selling system up at http://llms.info/members/login.php

Log in as admin/admin >> Databases Tab >> Then Try Transactions Database

I need the dollar or pound signs to show up in the money fields.
If there is anyway to do this I would love to hear it. This is the only thing holding up completion of my lead distribution and selling system. Thanks!

Sergey Kornilov admin 10/19/2010

You need to move this code to AfterAppInitialized event:



$myconn=db_connect();

$rs=db_query("SELECT * FROM admin WHERE(id='1')",$myconn);

$data=db_fetch_array($rs);
$locale_info["LOCALE_ICURRDIGITS"]="2";

$locale_info["LOCALE_ICURRENCY"]="0";

$locale_info["LOCALE_INEGCURR"]="0";

$locale_info["LOCALE_SCURRENCY"]=$data['rate2'];

$locale_info["LOCALE_SMONDECIMALSEP"]=".";

$locale_info["LOCALE_SMONGROUPING"]="3;0";

$locale_info["LOCALE_SMONTHOUSANDSEP"]=",";