First off, use double quotes on your query string.
Example:
PHP Code:
$sql = "INSERT INTO blah blah blah...";
This will allow you to use the single quotes for the names, without escaping it.
Second, you're inserting the variable wrong. Do it like this:
PHP Code:
'".$variable."'
or