I have a page where I am trying to retrieve a value from the URL bar to then be used as an argument in an sql call. However I am having some issues.

The url is XXXXXXXXXX.php?mid=314

At the top of my code i have

```
$mid = (int)trim($_GET['mid']," "); // Method A: This version does not work
$mid = 314; // Method B: This version does work

$mission = $db->getTableInfoForMission($mid); 
// This is the sql call that works for Method B and fails for Method A.

```

I have output the value of $mid and it appears to be 314, is there something I am missing?

Thanks

EDIT\*

After trying //var\_dump($mid); die(); for both cases I get int(314), yet still one method fails and the other does not. I get an invalid SQL syntax failure for method A