Can't save a new record

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
kanklovitch
Veteran Member
Posts: 159
Joined: 2019-02-03 17:26

Can't save a new record

Post by kanklovitch » 2021-06-01 22:55

Hi Guys
Well I just got my last problem has gone away but a new problem has popped up. My primary field in one table set to auto increment will not let me add a new record. My other primary fields in my other tables are all set the same way and work perfectly. In PHP Admin under Extras all my other primary fields in the various tables says Auto Increment but not in this one. AppGini will not fix it.

I can edit records in AG and I can also insert a new record in PHP Admin.

I am totally stumped, I have re-generated the application numerous times.

I hope this is easier to solve than my last glitch.

Ken
Attachments
primary 2.jpg
primary 2.jpg (91.93 KiB) Viewed 2427 times
primary3.jpg
primary3.jpg (52 KiB) Viewed 2427 times
primary1.jpg
primary1.jpg (109.41 KiB) Viewed 2427 times
primary4.jpg
primary4.jpg (47.52 KiB) Viewed 2427 times

kanklovitch
Veteran Member
Posts: 159
Joined: 2019-02-03 17:26

Re: Can't save a new record

Post by kanklovitch » 2021-06-02 13:02

Good morning Guys
Late last night I was suddenly able to save a new record for the one table. Many times through out the day I re-generated my application with my primary field set to auto increment and in yet it wouldn't allow me to save a new record and as well AppGini couldn't "fix" the field as usual. I cleared my browsing data many times so that was not the issue. Is their some kind of explanation that will help me understand this for the future.

The title of this section of the Forum is "Annoyances & Bugs" and yesterday that was the perfect title for my experience. I spent a couple of hours out of my busy day in the shop trying to add a record to my database and in the end I learnt nothing about why it wouldn't and why it suddenly started to.

I really appreciate your help guys, I still love AppGini, I couldn't manage my business without it.

Ken

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Can't save a new record

Post by peebee » 2021-06-02 22:43

I can't explain why it isn't working but have you tried editing the structure of that particular field in phpMyAdmin - check the Auto Increment box and Save? See what happens?

Do you have more than one auto increment field in that table? That wont work.

I'm pretty sure that the only three files in your generated AppGini app that relate to AUTO_INCREMENT are updateDB.php, admin/inFunctions.php and admin/pageRebuildFields.php Check those files and see if gravestones_ID is set to AUTO_INCREMENT (you could compare it to another primary key field in another table that is AUTO_INCREMENT to see how it should look). If gravestones_ID is not AUTO_INCREMENT in each of those files, that will likely be the cause of the problem. If that is the case - why they wouldn't have been overwritten when you regenerated your app I can't say? Certain you reuploaded every file from the regenerated app?

Other than that, sorry but I'm out of ideas.

kanklovitch
Veteran Member
Posts: 159
Joined: 2019-02-03 17:26

Re: Can't save a new record

Post by kanklovitch » 2021-06-03 12:40

Hi peebee
I am positive I did everything right. I only have one primary field with auto increment, all my tables are set like that. Yes for absolute certainty I uploaded all the files in my app. I must have done it 10-12 times throughout the day but I couldn't add a new record, nor would AppGini fix it when I tried to rebuild the fields. Near the end of the day for some unknow reason after changing absolutely nothing it started to work. During the day I could add a new record in phpAdmin if I wanted to.

Thanks very much for your suggestions on inspecting the relevant files, I am out of my shop today, I will check those later and see what I can learn.

I might be wrong about this but a couple of years ago I think I remember I had the same or similar problem. As I recall, I think I had to "reset" something in AppGini. I think maybe something to do with AppGini not allowing me to change the data type.

Anyways everything is working normally now.

Ken

pfrumkin
Veteran Member
Posts: 157
Joined: 2020-02-18 17:58
Location: Albuquerque, New Mexico USA

Re: Can't save a new record

Post by pfrumkin » 2021-06-03 18:51

Hi Ken,

When deploying an update that includes a database update I start with removing the setup.md5 file on the site. I don't see that in your write up, maybe I missed it.

~Paul

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Can't save a new record

Post by pbottcher » 2021-06-03 19:05

Hi,

as it is not easy to know what the source of the issue could be, I'd rather look at fixing the problem. If it is fixed already, ignore my comment.

Otherwise check again in phpmyadmin if the gravestones_ID is set to AUTO_INCREMENT now. If not, just do that via phpmyadmin.

Then go back to your App and run the rebuild fields and check the database again. It should be fine then.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

kanklovitch
Veteran Member
Posts: 159
Joined: 2019-02-03 17:26

Re: Can't save a new record

Post by kanklovitch » 2021-06-03 23:35

Hi pbottcher,

Thanks for the comment, I just learned something about phpmyadmin. Auto Increment was not set for the the primary field in the one table in question and I couldn't figure out how to change it. I didn't see that check box for A-I before. As I said everything is working fine now but I would still like to know why it was not set when it was defined in AppGini and why after 10 hours or so it mysteriously started to work without me changing anything except regenerating the app. Is the problem with AppGini, phpmyadmin or my service provider?

Thanks pbottcher.

Hi Paul
Do I understand you correctly that you always delete the setup.md5 when you upload changes to your site? Is that what we are supposed to do or is it something you just do for some reason?

Thanks Paul

pfrumkin
Veteran Member
Posts: 157
Joined: 2020-02-18 17:58
Location: Albuquerque, New Mexico USA

Re: Can't save a new record

Post by pfrumkin » 2021-06-06 19:55

Hi Ken,

The setup.md5 file is a flag to run the database schema changes in updatedb.php file.

~Paul

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Can't save a new record

Post by jsetzer » 2021-06-07 06:12

There are several files you should exlude from upload. Maybe I forgot some, but I'll give it a start here:
  • config.php
  • config.bak.php
  • setup.md5
  • *.axp
    I got used to save my project files within the same directory for convenience reasons. But I do not upload them to production servers.
  • Thumbs.db
  • ./images/
    Keep blank.gif and index.html
  • ./import-csv
    There may be more files/images in this directory, uploaded to localhost while testing. Usually, those are not required on serverside.
  • ./admin/backups/
    Keep .htaccess and index.html
    There may be backup files of your local database here. The should not be uploaded to your server
  • ./admin/csv
Perhaps others can contribute.

---
Personally, I am using the following blacklist*:
@/*.axp
@/.release
@/.vscode
@/.VSCodeCounter
@/.backup
@/backup
@/.docs
@/docs
@/*.code-workspace
@/*.url
@/setup.md5
@/config.php
@/config.bak.php
@/hooks/readme.html
@/hooks/backup
@/resources/lib/backup
@/images/thumbs.db
@/images/*.pdf
@/images/*.jpg
@/admin/images/thumbs.db
@/admin/incFunctions.backup.*.php
@/admin/backups

* Note that there will by directories you don't have in your machine, created by my IDE or by workchain tools I am using.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

kanklovitch
Veteran Member
Posts: 159
Joined: 2019-02-03 17:26

Re: Can't save a new record

Post by kanklovitch » 2021-06-09 14:05

Hi Jan
Do you mean don't include those files when regenerating my app or when I ftp to the server? Does AG documentation say that somewhere or is this something you have learned by experience?

Thank you

Ken
Attachments
regenerating.jpg
regenerating.jpg (124.11 KiB) Viewed 2197 times

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Can't save a new record

Post by jsetzer » 2021-06-09 19:24

Don't overwrite especially config.php and setup.md5 when uploading to your server using FTP or whatever.

Yes, it is documented somewhere, but don't ask me where I read it during my first steps with AppGini.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply