Jump to content

Dewd

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Dewd's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I have a bit of a problem with a simple message board using a SQLite database. When my script queries: SELECT * FROM posts ORDER BY id ASC It works absolutely fine. When I try to: sqlite_query($handle, "INSERT INTO posts (name, post, date) VALUES ('" . $message_name . "', '" . $message_msg . "', '" . $message_date . "')") or die("Error in query: ".sqlite_error_string(sqlite_last_error($handle))); It gives me a error saying: Warning: sqlite_query() [function.sqlite-query]: unable to open database file in *script location* on line 24 Error in query: unable to open database file. The whole condition is: if (isset($_POST['name']) && isset($_POST['msg'])) { $message_name = $_POST['name']; $message_msg = $_POST['msg']; $message_date = date("d/m/y"); sqlite_query($handle, "INSERT INTO posts (name, post, date) VALUES ('" . $message_name . "', '" . $message_msg . "', '" . $message_date . "')") or die("Error in query: ".sqlite_error_string(sqlite_last_error($handle))); echo '<b>Your post was successful!</b><br/>' ; } Is there something wrong? Am I using the strings wrongly? Is there a error in the query? Thanks for any help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.