Using Session.MM_Username in a PHP MySQL Query
When you want to use Session.MM_Username in the WHERE clause of a query, use this example for reference:

$username = $_SESSION['MM_Username'];
mysql_select_db($database_CostFlow, $CostFlow);
$query_accounts = "SELECT cost_accounts.autonum, cost_accounts.acnt_type, cost_accounts.acnt_num,  cost_accounts.acnt_compcode, cost_users.user_name, cost_users.user_compcode
FROM cost_accounts, cost_users 
WHERE cost_accounts.acnt_compcode = cost_users.user_compcode AND cost_users.user_name = '$username'
ORDER BY acnt_num ASC";

Archives