Couple of PHP - MYSQL Scripts, trying to pass thru variable
Posted: Sun Jun 27, 2010 10:42 am
Hello All.
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 -
Where i have the function "function getYourJobs() " i want to pass a variable into the query rather than "7", the variable i want to pass through is "$ID_No" that i defined at the top of the script. Can anyone help me with this ? I have tried a few differnt ways to do it but cant seem to.
Any help would be great !
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 !