CAN NOT EDIT RECORDS
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)
-
repo owner -
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.
-
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
: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.
-
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"
-
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.
-
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.
-
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.
-
repo owner - removed component
-
repo owner - changed status to resolved
Solved (not enough feedback for remaining issue)
- Log in to comment
Please give more details
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).