I am attempting to get a variable from a querystring and then if that value is equal to a value in my XML data, I want to print out a table with details about that particular job.
Here is where I get my first value:
$thisjob = $_GET["jobnum"];
Then I enter a loop that goes through all my XML data and I have created an echo statement for now to see what exactly is going on. I'm leaving some stuff out, but it's mainly the IF statement I'm concerned with, the rest works fine.
echo $jobid. "==" .$thisjob. "<BR>";
if ($name == "JOB" AND number_format(trim($jobid)) == number_format(trim($thisjob)))
{
// Table with this job information will be created here
}
This is the output that this will create when the querystring value is 23:
==23
==23
==23
23==23
==23
==23
==23
==23
==23
==23
24==23
==23
==23
==23
==23
==23
==23
25==23
==23
==23
==23
==23
==23
==23
On the line when 23 is equal to 23, it should satisfy the IF conditions and print out the table, but it does not. If I hardcode 23 instead of 'number_format(trim($jobid))' in the IF statement, then it displays correctly. I thought maybe it was a number format issue, which is why I have the number_format and trim functions applied to them (it does the same thing without).
Any ideas why this doesn't work? I'm thinking it's something simple, but I don't really know what.