CAN NOT EDIT RECORDS

Issue #361 resolved
Former user created an issue

When trying to edit a record and click 'save changes', I get an error:

ERROR: This may be a bug that needs to be reported at https://bitbucket.org/phpliteadmin/public/issues?status=new&status=open

Comments (9)

  1. phpLiteAdmin repo owner

    Please give more details

    • The CREATE TABLE statement of your table
    • The column where you change the value and the new value you are trying to give it.

    Most likely you are trying to change the value to something that is not allowed by the table constraints. Like entering characters instead of numbers in a integer column that is also the primary key (ROWID).

  2. Saul Mugrabi

    I am trying to Update a record with the following statement:

    UPDATE users SET Paid="SI" WHERE user_id=1

    I am getting the error: ERROR: unable to open database file

    The field is not the primary key and it is a TEXT field.

  3. phpLiteAdmin repo owner

    Okay. Maybe its a permission problem? In the list of databases on the left, does it say [rw] or only [r] next to your database? If this is linux, try to change the owner of the file to the user of php/your webserver, mostly www-data:

    #!bash
    chown www-data mydbfile.sql
    

    If this is Windows, make sure the file is not marked read-only and your user has proper write rights.

  4. MartinL

    I too am unable to edit tables since I upgraded to ubuntu 18. DB rights is ok.

    here is nginx error.log

    PHP message: PHP Notice: Undefined index: function_0 in /home/berra/serios/phpliteadmin.php on line 1454 PHP message: PHP Notice: Undefined offset: 0 in /home/berra/serios/phpliteadmin.php on line 1462 PHP message: PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/berra/serios/phpliteadmin.php on line 1467" while reading response header from upstream, client: 82.91.12.42, server: localhost, request: "GET /serios/phpliteadmin.php?table=serier&action=row_edit&confirm=1&pk=%5B%22%5B45%5D%22%5D HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "kurri.as" 2018/05/25 09:04:06 [error] 1999#1999: 21944 FastCGI sent in stderr: "PHP message: PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/berra/serios/phpliteadmin.php on line 1467" while reading response header from upstream, client: 82.91.12.42, server: localhost, request: "POST /serios/phpliteadmin.php?table=serier&action=row_edit&confirm=1&pk=%5B%22%5B45%5D%22%5D HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "kurri.as", referrer: "https://kurri.as/serios/phpliteadmin.php?table=serier&action=row_editordelete&pk=%5B45%5D&type=edit" 2018/05/25 09:06:24 [error] 1999#1999: 21944 FastCGI sent in stderr: "PHP message: PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/berra/serios/phpliteadmin.php on line 1467" while reading response header from upstream, client: 82.91.12.42, server: localhost, request: "POST /serios/phpliteadmin.php?table=serier&action=row_edit&confirm=1&pk=%5B%22%5B45%5D%22%5D HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "kurri.as", referrer: "https://kurri.as/serios/phpliteadmin.php?table=serier&action=row_editordelete&pk=%5B45%5D&type=edit" 2018/05/25 09:09:45 [error] 1999#1999: *21958 FastCGI sent in stderr: "PHP message: PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/berra/serios/phpliteadmin.php on line 1467" while reading response header from upstream, client: 82.91.12.42, server: localhost, request: "POST /serios/phpliteadmin.php?table=serier&action=row_edit&confirm=1&pk=%5B%22%5B1%5D%22%5D HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "kurri.as", referrer: "https://kurri.as/serios/phpliteadmin.php?table=serier&action=row_editordelete&pk=%5B1%5D&type=edit"

  5. Saul Mugrabi

    I was able to solve the problem....

    This was the problem: "Attention: The database-file itself is writable, but to write into it, the containing directory needs to be writable as well. This is because SQLite puts temporary files in there for locking."

    The solution: I created a separate writable directory for the database.

    Now I am able to modify and update the database.

  6. phpLiteAdmin repo owner

    With commit 35883e1 all edit-features are now hidden when the db or its directory is readonly. And added another warning in case the db is readonly.

  7. phpLiteAdmin repo owner

    @sopparus Is your issue fixed as well? These warnings appear from PHP 7 onwards but they are no problem, just warnings and thus unrelated to your problem.

  8. Log in to comment