php - Can't insert links to DB -


i have code:

    if (!empty($_post['w1']) && !empty($_post['l1']))   {         $str = "<a href='".$_post['l1']."'>".$_post['w1']."</a>";         $content = str_replace($_post['w1'],$str, $content);     }     $content = nl2br($content);     echo "נוסף";     echo $content; mysql_query("insert `posts` values ('','".$_post['subject']."','$content','0')"); 

the php page doesn't return error. data isn't inserted db. know problem?

if there mysql error thrown, not shown you. following see error:

mysql_query("insert `posts` values ('','". mysql_real_escape_string($_post['subject']) . "','" . mysql_real_escape_string($content) . "','0')") or die mysql_error(); 

be aware of sql-injections!


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -