Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6897737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:12:27+00:00 2026-05-27T07:12:27+00:00

I am trying out sqlite with php. On the server when I execute the

  • 0

I am trying out sqlite with php. On the server when I execute the command sqlite3, it shows the version and help option suggesting that sqlite is installed there. My folder structure is like this: /username/public_html/
Now I created a db called “chatuser.db” with a table “Users” and two columns “Username” and “Password” using sqlite3 command at /username
I then copied the db using WinSCP to my windows folder and then copied it back to the server here: /username/public_html/ (I know it is not a good idea to keep db file in public_html, but am just trying out an example). Now I have the following php file:
add.php:

<?php

$password = $_POST['password'];
$username = $_POST['username'];

$name_es = sqlite_escape_string($username);
$password_es = sqlite_escape_string($password);

if (!empty($username)) {

   $dbhandle = sqlite_open('chatuser.db', 0666, $error);

   if (!$dbhandle) die ($error);

   $stm = "INSERT INTO Users(Username, Password) VALUES('$name_es', '$password_es')";
   $ok = sqlite_exec($dbhandle, $stm, $error);

   if (!$ok) die("Error: $error");  
   else echo "Success";
}
?>

index.html:

<html>
<head>
<title>Login Trial</title>
</head>
<body style="font-size:12;font-family:verdana">

<form action="add.php" method="post">

<p>
Name: <input type="text" name="username"><br>
Password: <input type="text" name="password"><br><br>

</p>

<p>
<input type="submit">
</p>

</form>


</body>
</html>

On clicking the submit button, it loads add.php, but does not show me the success message nor any error message. I am not able to figure out why. As an added note, I have done chmod 777 of chatuser.db as well. This is my first introduction to sqlite, any help would be great. Thanks

[SOLVED]
Found the issue, it was version mismatch. sqlite_open will not work. Alternative from this solution:
Error: file is encrypted or is not a database

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:12:28+00:00Added an answer on May 27, 2026 at 7:12 am

    My guess would be that sqlite_open triggers a fatal error and your PHP isn’t configured to show them.

    Try placing one echo before the sqlite_open and one after – if only the first one is echo’ed, you know what the issue is.

    You will probably want to load the sqlite3 module in PHP.

    -edit-

    Actually, that only applies to PHP 4, which you’re probably not using anymore. Either way, make sure that your PHP outputs errors (go into php.ini and set display_errors to On and error_reporting to E_ALL).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying how best to prepare my SQLite SQL strings in PHP. The SQLite3
Is there an extended function library for sqlite? I am trying out sqlite and
I'm trying to figure out the SQLite functionality for the iPhone, and I'm having
I am trying to create entities out of a SQLite database. SQLite doesnt have
I'm currently trying out db4o (the java version) and I pretty much like what
I have a few tables in SQLite and I am trying to figure out
We have a database on our master server (PHP/MySQL) that stores our data thats
I'm trying to figure out a way to execute some sort of search and
I'm trying to figure out what is the best general design for applications that
I am trying to get a GIF/PNG/JPG image out of a Sqlite database. Is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.