i have 1 table "table1" and 3 fields "field1" "field2" "field3".
from the mysql database i get the results that i want in the option box from the "table1" and the field1" as result from the query.
now my problem is.
How i get the result from "field2" and "field3"when i pick something from option box and pass it to a textbox?
like "textbox2" and "textbox3"
bellow is the code
Code: Select all
on menuPick pItemName
-- check the global connection ID to make sure we have a database connection
global gConnectionID
if gConnectionID is not a number then
answer error "Please connect to the database first."
exit to top
end if
-- construct the SQL (this selects all the data from the specified table)
put "embassie_address" into tTableName -- set this to the name of a table in your database
put "SELECT `embassie_address`.title FROM embassie_address " & tTableName into tSQL
-- query the database
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
-- check the result and display the data or an error message
if item 1 of tData = "revdberr" then
answer error "There was a problem querying the database:" & cr & tData
else
put tData into button "emb"
end if
end menuPick