Stream Update API not working

I would be very worried if you’re writing code like this all over your site. If so, your entire website is a walking SQL injection waiting to happen.

With that aside, you don’t seem to understand scope in PHP. You have a function that gets a url with curl. $clientID is not within the scope of that function.

While you could make it possible by using global $clientID; within the function, it’s not a recommended practice. You can read more about scoping in PHP at http://php.net/manual/en/language.variables.scope.php