mySQL database access with ports
Posted: Fri Apr 04, 2014 5:45 pm
Hey all....I am trying to connect to a godaddy.com mySQL database that I have and they have changed a few things up...now they are requiring an address that has a specific port and I am unsure if I am doing this correctly due to an error I keep getting....can someone take a look at the host connection line of the code and tell me if the syntax is correct for adding a port number to the address? Thanks...
Code: Select all
on mouseUp
-- use a global variable to hold the connection ID so other scripts can use it
global gConnectionID
-- set up the connection parameters - edit these to suit your database
put "p3nlmysql200plsk.secureserver.net:3303" into tDatabaseAddress
put "someUser" into tDatabaseName
put "someUser" into tDatabaseUser
put "Password" into tDatabasePassword
-- connect to the database
put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
-- check if it worked and display an error message if it didn't
-- & set the connection ID global
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
end mouseUp