Updating a MySQL Database after Text Fields are Changed
Posted: Sun Mar 24, 2019 9:12 am
Hello
My problem is similar to the original problem in this thread viewtopic.php?f=9&t=10022&p=178062#p178062, so I posted a reply there, but the thread didn't appear at the top of the forum, so I am reposting here.
Rather than a datagrid, I am having no success in updating the MySQL database that populates the first text field of each group of six groups within a containing group named "digest." My database is a MySQL database accessed via WAMP. I definitely made a connection to my MySQL database. The following code works when performing a single updating operation on my MySQL database, for example:
The following repeat loop worked when the database was sqlite, but not on the MySQL database. It has no effect when I change a text field and close the card. (Explanation: the name of the field, the name of the owning group, and the name of the database field are the same.)
Could it be the single quote/double quote syntax? I noticed that the query is written differently from the example in the other thread:
Monty
My problem is similar to the original problem in this thread viewtopic.php?f=9&t=10022&p=178062#p178062, so I posted a reply there, but the thread didn't appear at the top of the forum, so I am reposting here.
Rather than a datagrid, I am having no success in updating the MySQL database that populates the first text field of each group of six groups within a containing group named "digest." My database is a MySQL database accessed via WAMP. I definitely made a connection to my MySQL database. The following code works when performing a single updating operation on my MySQL database, for example:
Code: Select all
on closecard
put fld "id" into tID
put fld "judge" into tJudge
put "UPDATE MyTable SET judge = '"&tJudge&"' WHERE id = '"&tID&"'" into tSQL
revExecuteSQL gCourts_DatabaseID, tSQL
end closecard
Code: Select all
on closecard
repeat with x = 1 to 6
put the name of grp x of grp "digest" into tField[x]
put fld 1 of grp x of grp "digest" into tNewText[x]
put "UPDATE MyTable SET '"&tField[x]&"' = '"&tNewText[x]&"' WHERE id='"&tID&"'" into tSQL
revExecuteSQL gCourts_DatabaseID, tSQL
end repeat
end closecard
Changing the syntax to this pattern did not work for me either. Is the SQL code the same for both SQLite and MySQL in looping routines? Thanks for any replies. Sorry for the double posting, but it seems that my first post would never be noticed because the topic does not appear at the top of the list.AccountManager=" & "'" & (item 2 of line y of tUpgrade) & "'" & "
Monty