Hello - welcome to PHPBuilder! When posting PHP code, please use the board's [noparse]
..
[/noparse] bbcode tags as they make your code much easier to read and analyze.
As for your problem, it should be apparent where the problem is by the mismatched color coding. Specifically, after concatenating the contents of $userid onto the first string, you begin a second string with a double quote but later try to close it with a single quote.