Possible Duplicate:
Best way to stop SQL Injection in PHP
I have a piece of code that enters code into the database.
Code:
$database->sendUserMessage("You have a new profile comment", "To view your new profile comment, go to your <a href='profile.php?id=$user#comments'>profie</a>.", $user);
INSERT INTO ".TBL_MESSAGES." VALUES (NULL, '$title', '$message', '2', '$user', '0', '0', '0', '0', '0', NULL, NULL, NULL, NULL, now())
The problem i have is when attempting to pass the HTML into the query and execute, it won't execute. However, if I remove HTML, the query works fine.
Is there a way around this?
Thanks.