B4J Tutorial [BANanoVuetifyAD3] Create Professional Looking Vuetify WebSites & WebApps with BANano

roberto64

Active Member
Licensed User
Longtime User
Hi, with some configuration on lagon I made the database of your example part60 work, but I don't understand how you do to insert in the db "the name and the age" where do you get the data to be stored?
regards
 

Mashiane

Expert
Licensed User
Longtime User
but I don't understand how you do to insert in the db "the name and the age" where do you get the data to be stored?
In relation to the data, there is a BANanoFakeIT class that I found and extended and included it in BVAD3. For example, we are creating fake data on the btnAdd_click event.

B4X:
'event to add the record
Sub btnAdd_click(e As BANanoEvent)
    Dim dbMySQL As BANanoMySQLE
    dbMySQL.Initialize("test", "users", "id", "id")
    'add field types
    dbMySQL.SchemaAddInt(Array("id", "age"))
    dbMySQL.SchemaAddText(Array("name"))
    'create a new record, do not specify auto increment
    Dim faker As BANanoFakeIT
    faker.Initialize
    'create a fake record
    Dim urec As Map = faker.GetRecord1(Array("name", "age"))
    'insert current record
    dbMySQL.Insert1(urec)
    dbMySQL.JSON = banano.CallInlinePHPWait(dbMySQL.MethodName, dbMySQL.Build)
    dbMySQL.FromJSON
    Select Case dbMySQL.OK
        Case False
            Dim strError As String = dbMySQL.Error
            vuetify.ShowSnackBarError("An error took place whilst running the command. " & strError)
        Case Else
            vuetify.ShowSnackBarSuccess("User has been added successfully!")
    End Select
End Sub
 

Mashiane

Expert
Licensed User
Longtime User
Please Note: The latest working example of BVAD3 is available on GitHub. This contains the latest updates on the source code and improvements and bug fixes. This is based on Tutorial 60.


Enjoy!

PS: Should you find a bug or something is not working as expected, please post it here and if you solved something, please share so that anyone who experiences the same issue is able to find a reference to solve it.

Thank you so much!
 

roberto64

Active Member
Licensed User
Longtime User
Mashiane, I notice that starting your example "https://mashiane.github.io/BANanoVuetifyAD3/#/phpmysql" gives the same error it gave to me before configuring Largon. the error is "An error took place whilst running the command"

regards
 

roberto64

Active Member
Licensed User
Longtime User
Mashiane, I did a test on my host by adding a mysql db, and I noticed that on the pc with the google browser it works ok "save the data etc .. both with mysql and with sqlite, instead with the mobile it gives the erore of "An error took place whilst running the command" I wonder why everything is ok with a pc and no cell phone?
I think then that I leave the PHP file "mysqlconfig.php" so configured, the data are stored in your local mysql.
regards
 

Mashiane

Expert
Licensed User
Longtime User
The proplem is what you have written on the ServerIP string.

I see, it seems your server is not able to find the file, perhaps try and use .gio... as ServerIP (include the "www"), you are using port 80 isnt it? If so, then we dont need to include a port number.

I see there are double // on the address bar, that's incorrect, you are surely making a mistake somewhere, dont include the last / on the ServerIP string.

Try also type the full path on the address bar for the php file and see whether it does something, use your full URL to see if it returns {} or something.

You are almost there.
 

roberto64

Active Member
Licensed User
Longtime User
nothing, however I thought that in my linux server / host the sqlite extension must be installed, as I did with laragon by installing the sqlite extension.
regards
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…