I've been working on a message board for my company. Many things are going ok, but I've been getting this error when someone enters text in a textbox and uses apostrophes in their text (such as don't won't can't). It works fine without the apostrophes. I checked my php.ini and have magic_quotes_gpc to on and I've tried the addslashes() function, but I still get the error.

This is the error:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''This test doesn\'t' WHERE [ID] = 33'., SQL state 37000 in SQLExecDirect in C:\Inetpub\wwwroot\edit.php on line 36

Here is my script:
$joketextedt = addslashes($joketextedt);
if ("SUBMIT"==$updatejoke){
$sql = "UPDATE Jokes SET JokeText = '$joketextedt' WHERE [ID] = $editjoke2";
$editJoke = odbc_do($dbcnx,$sql);

I'm using a MS-access 2k database with php4. Any sudgestions??