I am having a problem inserting data into a MySQL database with PHP. Everything was working find until I moved my site from my hard drive to my host which has an older version of PHP (4.0.4 compared to my 4.1.1) and probably has an older version of MySQL also. Now, when I insert variables with special characters (like quotes, <>'s, []'s, and others), the insert doesn't work.
So, in short, my question is: what do I need to get the insert to work?
my current code looks like this:
$sql = "INSERT INTO posts SET text = \"" . $p_text . "\", title = \"" . $p_title . "\";
$sql_r = mysql_query($sql);
thats not exactally it, but that gives you an idea, I just need to know what to do so that it won't fail when there are special characters in the variables.