I can’t get my query to insert one of my vars while it is being appened. if i hard set it, it will insert.
preg_match_all("/<\s*p[^>]*>([^<]*)<\s*\/\s*p\s*>/", $new_post, $matches);
$article = ' ';
foreach ($matches[0] as $media){
$article .= $media;
}
$query = "INSERT INTO blog_post (date,article,link) VALUES('$date','$article','$guid_clean')";
mysqli_query($dbc,$query);
Everything works, IE I can echo out the $article and if I hard set it and skip the foreach I can even insert $article. $date and $guid_clean work fine.
You have not escaped your input variables with
mysql_real_escape_string(), and it is likely that an apostrophe or single-quote inside the article body is breaking and invalidating the SQL statement.