Insert data from custom PHP function into MySQL database <p>I'm having problems inserting a particular line of code into my MySQL database. It inserts three rows just fine, but the "html_href" row isn't going in for whatever reason. Here is my code:</p> <pre><code> function html_path() { $title = strtolower($_POST['title']); // convert title to lower case $filename = str_replace(" ", "-", $title); // replace spaces with dashes $html_href = $filename . ".html"; // add the extension } </code></pre> <p>And my MySQL query code:</p> <pre><code> $query = "INSERT INTO work (title, logline, html_href, synopsis) VALUES"; $query .= "('".mysql_real_escape_string($_POST['title'])."',"; $query .= "'".mysql_real_escape_string($_POST['logline'])."',"; $query .= "'".html_path()."',"; $query .= "'".mysql_real_escape_string($_POST['synopsis'])."')"; $result = mysql_query($query); </code></pre> <p>The title, logline, and synopsis values go in just fine, but the <code>html_href()</code> function inserts a blank row.</p>