I am having a problem assigning variables to constants in a class. I am using Authorize.net AIM class and want to assign the login and transaction key that is stored in a database. However, it doesn’t allow it and in the code below, I have to use the actual string to make it work.
Can someone help me out on how to make this work with the const variables?
Thanks in advance.
[CODE]
<?php
include(“../include/connectionString.php”);
$query = mysql_query(“SELECT * FROM admin”);
while ($get = mysql_fetch_array($query)) {
$login = $get[‘authnetLogin’];
$transKey = $get[‘authnetTranskey’];
}
class AuthnetAIMException extends Exception {}
class AuthnetAIM
{
const LOGIN = ‘123456’;
const TRANSKEY = ‘123456’;
//trying to assign variables here from query above….
// const LOGIN = $login;
// const TRANSKEY = $transKey;
const TEST = false;
const GODADDY = false;
private $params = array();
private $results = array();
private $approved = false;
private $declined = false;
..rest of code