cool. thank you!
okay, before i forget to mention. does "addslashes" and/ or "stripslashes" pertain only to an instance when "magic quotes" are being used?
to the best of my knowledge, i'm NOT using magic quotes-- but i think my hosting provider might be using it-- that's possible, right? if so, will this have bearing upon the way i need to code my apps-- the code may need to be modified to work when i upload the files, vs the way i have my testing server configured? in other words, must i use precautionary code to accommodate whether the "Magic quotes" are enabled or not? (okay, that's separate question #1, and here comes another)
the INSERT query which you've used to illustrate the proper use of the addslashes() function (w/ the single, then double quotes, and concatenation), as i stated above, was suggested to me as a solution to a completely different error -- Duplicate entry '' for key 2" -- which i later discovered would be solved by fixing an erroneous IF statement where: if ($var1 == $var2 ) needed to be used, instead of my original, erroneous: if ($var1 = $var2)
so, since i discovered the true source of that original error, i decided to go back and try my original SQL INSERT query (as indicated above in thread post #3 here).
my question is this-- when i switched back to using my original query, i have NO problems-- until i use a name like in my $_POST data, such as O'leary, for example. that, of course, produces an "error in my SQL syntax". so, i went back to my original INSERT query, and added the addslashes syntax as shown here in post #4-- but apparently that is also wrong because, typing the name O'leary, causes the "error in your SQL syntax..." where the apostrophe exists.
MY QUESTION:
so, is the use of '" . addslashes($POST['L_NAME']) . "' then for the specific purpose of avoiding this error-- so that the $POST data is properly recorded with or without an apostrophe, depending on the user data entry? in other words, the syntax
'" . addslashes($_POST['L_NAME']) . "'
is used so that the $_POST['string'] is properly passed to mySQL instead of addslashes[$post['string'] being itself inserted? that's the impression that i get from all of this-- that i must go back to using the INSERT query as illustrated by coreyp_1,
'" . addslashes($_POST['L_NAME']) . "'
instead of my version which is sans the single quote, double quote, space, concat-- like so "INSERT into interest values ('', '$_POST['F_NAME']', ...)