Im making little app just for fun about choosing movie by selecting genre actors ...
my code looks like
Code: Select all
on mouseUp
global gConnectionID
put "johnny.heliohost.org" into tDatabaseAddress
put "s" into tDatabaseName
put "name" into tDatabaseUser
put "pass" into tDatabasePassword
-- connect to the database
put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
if tResult is a number then
put tResult into gConnectionID
answer info "Connected to the database." & cr & "Connection ID = " & gConnectionID
else
put empty into gConnectionID
answer error "Unable to connect to the database:" & cr & tResult
end if
global gConnectionID
put field "genre" into theSearchString
put field "year" into theSearchString2
put field "actors" into theSearchString3
get revDataFromQuery(tab, return, gConnectionID, "SELECT * FROM movies WHERE Genre LIKE '%" & theSearchString & "%' AND Year "& theSearchString2 &" AND Actors LIKE '%" & theSearchString3 &" % '" )
set the dgText of group "datagrid 1" to it
end mouseUp
thanks