Quote from Damasiciccio on May 21, 2024, 9:29 amI am a beginner and am trying to learn how to use VisualNeo Win. I take my cue from the various tutorials to try to get to my goal.
I would like to create a small address book, at the moment locally.
I can read the data from the database, but if I make a change to the record via an input container, I cannot store the changes.
Where do I go wrong?
Thank you in advance for any suggestions.
I am a beginner and am trying to learn how to use VisualNeo Win. I take my cue from the various tutorials to try to get to my goal.
I would like to create a small address book, at the moment locally.
I can read the data from the database, but if I make a change to the record via an input container, I cannot store the changes.
Where do I go wrong?
Thank you in advance for any suggestions.
Uploaded files:
Quote from luishp on May 21, 2024, 1:57 pm@damasiciccio please check this included sample app (look under MyDocuments\visualneoweb\sample apps\neoPhpSamples folder in your computer) :
https://visualneo.com/tutorials/neotabledb/
User: admin
Pass: admin
@damasiciccio please check this included sample app (look under MyDocuments\visualneoweb\sample apps\neoPhpSamples folder in your computer) :
https://visualneo.com/tutorials/neotabledb/
User: admin
Pass: admin
Quote from Damasiciccio on May 21, 2024, 5:17 pmThank you luishp,
I have solved it. I indicate below the solution I found because it was not explicitly stated in the various tutorials.
Simply, in the command
neoPhpExecSql "AliasArchiveDB" "updateRubric" "[SURNAME]::[NAME]::[DEPARTMENT]::[TEL1]::[TEL2]::[TEL3]::[TEL4]::[REFERENT]::[ID]" "saveRubric"
the order of the fields must be the same as those appearing in the SQL query, in the same sequence.
Thank you luishp,
I have solved it. I indicate below the solution I found because it was not explicitly stated in the various tutorials.
Simply, in the command
neoPhpExecSql "AliasArchiveDB" "updateRubric" "[SURNAME]::[NAME]::[DEPARTMENT]::[TEL1]::[TEL2]::[TEL3]::[TEL4]::[REFERENT]::[ID]" "saveRubric"
the order of the fields must be the same as those appearing in the SQL query, in the same sequence.

Quote from Phil78 on May 21, 2024, 7:14 pmHi @damasiciccio
There are several problems.
1 in config.php the update is $sqlQuerys[1]="UPDATE RUBRICA SET COGNOME = ?, NOME = ?, REPARTO = ?, TEL1 = ?, TEL2 = ?, TEL3 = ?, TEL4 = ?, REFERENTE = ? WHERE ID = ?";2 In pushbuttonSave ID must be the last member to match the update query:
neoPhpExecSql "AliasArchivioDB" "updateRubrica" "[COGNOME]::[NOME]::[REPARTO]::[TEL1]::[TEL2]::[TEL3]::[TEL4]::[REFERENTE]::[ID]" "backFromServer"3 In parsedatarubrica you must put the name of the function to avoid a table init error: neoTableInitTable "Container1" "it-IT" 0 "Table" false true false false false "backFromServer"
4 You can simplify the Gestione contatti pushbutton action by avoiding a SQL query which is the same as the original one, and populating variables directly with [miobj]
SetVar [currentRecord] [selectedRow]-1SetVar [ID] [miobj([currentRecord])('ID')]
SetVar [COGNOME] [miobj([currentRecord])('COGNOME')]
SetVar [NOME] [miobj([currentRecord])('NOME')]
SetVar [REPARTO] [miobj([currentRecord])('REPARTO')]
SetVar [TEL1] [miobj([currentRecord])('TEL1')]
SetVar [TEL2] [miobj([currentRecord])('TEL2')]
SetVar [TEL3] [miobj([currentRecord])('TEL3')]
SetVar [TEL4] [miobj([currentRecord])('TEL4')]
SetVar [REFERENTE] [miobj([currentRecord])('REFERENTE')]5 finally, for pushbutton save you don't need to use the salvaRubrica function, since you reload loadRubrica afterwards.
There are several problems.
1 in config.php the update is $sqlQuerys[1]="UPDATE RUBRICA SET COGNOME = ?, NOME = ?, REPARTO = ?, TEL1 = ?, TEL2 = ?, TEL3 = ?, TEL4 = ?, REFERENTE = ? WHERE ID = ?";
2 In pushbuttonSave ID must be the last member to match the update query:
neoPhpExecSql "AliasArchivioDB" "updateRubrica" "[COGNOME]::[NOME]::[REPARTO]::[TEL1]::[TEL2]::[TEL3]::[TEL4]::[REFERENTE]::[ID]" "backFromServer"
3 In parsedatarubrica you must put the name of the function to avoid a table init error: neoTableInitTable "Container1" "it-IT" 0 "Table" false true false false false "backFromServer"
4 You can simplify the Gestione contatti pushbutton action by avoiding a SQL query which is the same as the original one, and populating variables directly with [miobj]
SetVar [currentRecord] [selectedRow]-1
SetVar [ID] [miobj([currentRecord])('ID')]
SetVar [COGNOME] [miobj([currentRecord])('COGNOME')]
SetVar [NOME] [miobj([currentRecord])('NOME')]
SetVar [REPARTO] [miobj([currentRecord])('REPARTO')]
SetVar [TEL1] [miobj([currentRecord])('TEL1')]
SetVar [TEL2] [miobj([currentRecord])('TEL2')]
SetVar [TEL3] [miobj([currentRecord])('TEL3')]
SetVar [TEL4] [miobj([currentRecord])('TEL4')]
SetVar [REFERENTE] [miobj([currentRecord])('REFERENTE')]
5 finally, for pushbutton save you don't need to use the salvaRubrica function, since you reload loadRubrica afterwards.
Quote from Damasiciccio on May 22, 2024, 9:31 amThank you very much
Thank you very much