0

My problem is, that on one server the following sqlite query will work and on another server, the sqlite query is printet out as plain text.

the code looks like:

<?

$db = new SQLite3("../data/data.db");

if (!empty($_POST['inputDateTime']) && !empty($_POST['inputShortName']) && !empty($_POST['textareaBreakingnews']))
{

    $received_date = $_POST['inputDateTime'];
    $received_short_name = mb_strtoupper($_POST['inputShortName']);
    $received_breaking_news = $_POST['textareaBreakingnews'];

    $query = $db->query("INSERT INTO news (news_text, date_created, callback_person) VALUES ('$received_breaking_news', '$received_date', '$received_short_name')");


    if ($query)
    {
        echo "News were added.";
    }
    else
    {
        die(header("HTTP/1.0 404 Not Found"));
    }
}

the result is the following:

query("INSERT INTO news (news_text, date_created, callback_person) VALUES ('$received_breaking_news', '$received_date', '$received_short_name')"); if ($query) { echo "News were added."; } else { die(header("HTTP/1.0 404 Not Found")); } }

in the xampp configuration sqlite and sqlite3 are enabled and there is no problem to read the sqlite database.

I think there is one litte thing, that I have overlook.

wuk986
  • 142
  • 2
  • 16

0 Answers0