Cannot update database

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Cannot update database

Post by bambinou » 2013-02-01 23:23

Hi ,


I am having a problem here and cannot find a quick solution.

I have created a project, set up xampp, everything is working fine. I have now added a new table to my project, saved the code and generated the php, but how can I have the changes in AppGini to reflect in my database please? I am in phpmyadmin and the new table is not being added.


Thanks,

Ben

bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Re: Cannot update database

Post by bambinou » 2013-02-03 22:47

Problem solved.
I installed Xampp with all it's modules9phpmyadmin, mysql, apache...) I then created a user(not root), unfortunately, this user did not have all the required privileges, when I changed it to "Root user", the AppGini script was able to write to the database all the previous changes.

Ben

kai2209
Posts: 2
Joined: 2013-03-07 06:37

Re: Cannot update database

Post by kai2209 » 2013-03-07 07:07

Hi all,

i do have the same problem. Using XAMPP. I have modified the structure (added a field in a table and changed a propertie in another filed. Recreated the script files, replaced them in htdocs directory but the structure wont change. It still remains the same. What i am doing wrong. Just testing and using root account.

I am using the free version until now for testing but the files are reacreated so this should work for my understanding. Any help will be appreciated.

thanks and best regards
Kai

Johnk
AppGini Super Hero
AppGini Super Hero
Posts: 68
Joined: 2013-01-09 03:47
Location: Cairns, Australia

Re: Cannot update database

Post by Johnk » 2013-03-07 09:59

G'day Kai. There's a pesky little file in your script root called setup.php. Delete it and recompile. That should update the scripts. Please try that first.

I'm not sure how brilliant the MYSQL update command is. Adding a new table is okay, but adding a field to an existing table could be a bit hit and miss. Recompile the script, then use PHPMyAdmin to see if the field has been added. You may have to do it manually if your database contains working data.

The forum's gone to sleep this week. maybe someone with more knowledge can help when they all wake up.

I don't think the problem is with XAMPP or AppGini, or maybe your browser. I'm more inclined to think it's to do with MYSQL, but don't forget to clear your browser cache and use the browser refresh button often!

kai2209
Posts: 2
Joined: 2013-03-07 06:37

Re: Cannot update database

Post by kai2209 » 2013-03-07 11:49

John,

despite i have already deleted "all" files (as far as i remember) i just deleted the setup.php, recompiled and after reconnecting to the mssql database everything looks fine.

I think i should spend the money and give it a try. Looks fine.

Thank you so much, appreciate your help!!

regards
Kai

Johnk
AppGini Super Hero
AppGini Super Hero
Posts: 68
Joined: 2013-01-09 03:47
Location: Cairns, Australia

Re: Cannot update database

Post by Johnk » 2013-03-07 14:59

Kai, it will be money well spent. I think Ahamad may begin adding many new features now that he has a forum where he can communicate with his users.

I don't look into the workings of AppGini, but I think if you do a "Full" compile, over an older one, AppGini doesn't update setup.php. You have to physically remove it yourself or the old version will be kept. Bug? I don't know.

Regards,

John

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Cannot update database

Post by KSan » 2013-03-07 17:10

This has been tricky for me as well. Adding a table is usually ok but adding a field gets messy. Especially, re-ordering fields is a surely asking for trouble. Sorry for not having a solution.

Johnk
AppGini Super Hero
AppGini Super Hero
Posts: 68
Joined: 2013-01-09 03:47
Location: Cairns, Australia

Re: Cannot update database

Post by Johnk » 2013-03-08 04:30

Adding a table shouldn't pose any problems. It's just a MYSQL command "Create table if not exists" which AppGini will execute. Ditto adding a field. AppGini should add the field okay, but as the table exists you will probably need to delete setup.php. As I said, I haven't delved into the why's and wherefore's of AppGini, but it seems the script WON'T try to update the database while setup.php exists in your script folder. Until setup.exe is removed, AppGini will try to use the original database even when the script has been recompiled.

Changing the field order is an AppGini function and has nothing to do with MYSQL. The database fields can be in any order according to which ones you want at, or near the top in your data view.

I think you need to figure out (or understand) what affects the MYSQL database and what is done in the AppGini script. Adding a table or field and changing keys affects the database. Everything else is done by AppGini and providing AppGini allows you to do it, there shouldn't be a problem.

Just remember to clear your browser cache, or at least use the browser refresh button. You see Ahmad doing the latter ALL the time in his video demos.

User avatar
dilitimor
Veteran Member
Posts: 36
Joined: 2013-01-10 02:45
Location: Jakarta, Indonesia
Contact:

Re: Cannot update database

Post by dilitimor » 2013-04-24 02:43

i used to delete setup.md5 as well

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

Re: Cannot update database

Post by peebee » 2013-04-25 02:14

You'll find your regenerated AppGini files contains an updateDB.php

If you've created any new tables/fields or edited any existing, that file contains the relevant SQL commands to make the changes to the database

You may need to delete the stepup.md5, then just navigate to the index (or setup.php) page, connect to your database and the updateDB.php script will make any changes required.

Hope that helps

User avatar
toconnell
Veteran Member
Posts: 204
Joined: 2013-04-09 19:29
Location: Oklahoma City, OK
Contact:

Re: Cannot update database

Post by toconnell » 2013-06-06 13:09

The folder where you saved the entire file.. just empty it into the trash and then hit your magic wand in app gini again and reload it, then zip and upload to your server and all should be well.
Tina O'Connell
Web Dev & Appgini FAN

Post Reply