Access database error with php

Im using php to insert data into an access database. Right now if there is an apostraphe in the form data im getting this error

[microsoft][odbc microsoft access driver] syntax error (missing operator) in the query expression…

I know this is caused by an apostraphe and I have magicquotes gpc turned on in the ini file so i dont get why this is happening. My boss is breathing down my neck about this database error so does anyone know a way around this? Ive tried stripslashes() addslashes() and neither work.

Here is my code if that helps


	//Establishes connection to the access database

	//Check to see if the form was submitted correctly
	if(isset($_POST['Submit'])) { //check if form was submitted

	//create an empty variable to store potential error messages.
	$message = NULL; 
	//Check to see if Description was entered
	if (empty($_POST['Description'])){
		$d = FALSE;
		$message .= '<p>Your forgot to enter the description</p>';
		$d = $_POST['Description'];

	//Check to see if benefits were entered
	if (empty($_POST['Benefits'])){
		$b = FALSE;
		$message .= '<p>You forgot to enter the benefits</p>';
		$b = $_POST['Benefits'];
	//Check to see if Other was entered
	if (empty($_POST['Other'])){
		$o = 'User did not enter';
		$o = $_POST['Other'];
	//Check to see if Name was entered
	if (empty($_POST['Name'])){
		$n = 'User did not enter';
		$message .= '<p>You forgot to enter your name</p>';
		$n = $_POST['Name'];

	echo $message;
	//Check for description and benefits and then run query to insert the data into access database.
	if($d && $b){
		//Run insert Query
		$query = "INSERT INTO suggestions(name, idea, benefits, other) 
		VALUES ('$n', '$d', '$b', '$o')";
		$result = odbc_exec($odbc, $query) or die (odbc_errormsg());

	//check if query ran OK and then print confirmation message to user.
			echo 'Your suggestion has been submitted<br /><br /><a href=View.php>View Your Suggestion</a>';
			echo'System error, if the problem persists please contact the help desk at 2610';
	//closes connection to the access database.

Thanks in advance