I am using AMFPHP in conjunction with flex. It basically lets me return mysql queries for flex in an easier format. But i am having troubles using a variable to determine one of the query's.
My php code is -
Code: Select all
<?php
class jobs
{
var $db_host = 'localhost';
var $db_name = '';
var $db_user = '';
var $db_pwd = '';
var $ID_No = '7';
function jobs()
{
$this->methodTable = array(
"getJobs" => array(
"description" => "Info Database",
"access" => "remote"
)
);
}
function getAllJobs()
{
$mysql = mysql_connect($this->db_host, $this->db_user, $this->db_pwd);
mysql_select_db( $this->db_name);
$Query = "SELECT * from usernames WHERE level = 'clientuser'";
$Result = mysql_query( $Query );
return( $Result );
}
function getAllLinkedCompany()
{
$mysql = mysql_connect($this->db_host, $this->db_user, $this->db_pwd);
mysql_select_db( $this->db_name);
$Query ="SELECT * from usernames WHERE assignedrecruiter ='7'";
$Result = mysql_query( $Query );
return( $Result );
}
function getAllUsers()
{
$mysql = mysql_connect($this->db_host, $this->db_user, $this->db_pwd);
mysql_select_db( $this->db_name);
$Query ="SELECT * from usernames WHERE level ='clientuser'";
$Result = mysql_query( $Query );
return( $Result );
}
function getAllCustomers()
{
$mysql = mysql_connect($this->db_host, $this->db_user, $this->db_pwd);
mysql_select_db( $this->db_name);
$Query ="SELECT * from usernames WHERE level ='customer'";
$Result = mysql_query( $Query );
return( $Result );
}
function getYourJobs()
{
$mysql = mysql_connect($this->db_host, $this->db_user, $this->db_pwd);
mysql_select_db( $this->db_name);
$Query ="SELECT * from jobs WHERE assignedrecruiter ='7'";
$Result = mysql_query( $Query );
return( $Result );
}
}
?>
Any help would be great !