在mysql数据库表格单元格中插入链接

I have a notification system on my website where users will be notified of a certain event. The message of the notification will be stored in a MySQL database.

When I insert links into the message, it returns a MySQL error saying it cannot insert links.

How can I achieve that? I am using php.

Almost all links will include characters that will be interpreted by a sql database in an odd manner, leading to unpredictable results based on the varied input. You should ensure these characters are properly escaped:

$some_input = getInputFromWebPage();
$safe_input = mysql_real_escape_string($someInput);
insertIntoDB($safe_input);

That is just an example, and obviously not working code, but hopefully it heads you in the right direction. There are several functions that will add escape characters to strings for you.