Forum Moderators: coopster
$query_getResource = "SELECT EmpNo, FirstName, LastName FROM resources WHERE resources.EmpNo = " .$getAssignment['EmpNo'];
Does anyone have any ideas of how i could possibly rewrite this so that it would be acceptable?
I'm only able to echo the value once I remove the variable .$getAssignment['EmpNo'].
So now the code looks like:
$query_getProject ="SELECT ProjectID, ProjectName FROM projects" This of course will return a string of "SELECT ProjectID, ProjectName FROM projects" if I echo it, but it doesn't complete the SQL I need. In order to complete the query, I need to be able to set the WHERE clause based on this php variable.
Any other suggestions?
$query_getResource = "SELECT EmpNo, FirstName, LastName FROM resources WHERE resources.EmpNo = " .$getAssignment['EmpNo'];
SECURITY ADVISORY [securityfocus.com]:
Get in the habit of doing this:
$query_getResource = "SELECT EmpNo, FirstName, LastName FROM resources WHERE resources.EmpNo = '" .mysql_real_escape_string($getAssignment['EmpNo'])."'";
Note that I stuck an extra single quote on either side of the variable. That may help.