connecting to mysql
Mark Schonewille
m.schonewille at economy-x-talk.com
Sat Sep 29 02:05:19 EDT 2012
Hi Mark,
What made you think that you could use the RunRev server to test your own MySQL scripts? Have you got any documentation from RunRev about this?
Usually, web hosting companies don't allow remote connections. You need a script on your server as a layer between LiveCode and MySQL, which is usually written in PHP or ASP but could also be a LiveCode server script or a CGI script. Such a script handles URL's or web forms, which are sent to the server with the POST or GET method. You can connect to it from within LiveCode using put/get URL or post to URL commands.
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553
Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com
On 29 sep 2012, at 05:59, Mark Smith wrote:
> Hi, I'm looking for a test site I could use to test some code. I've got the
> following working for a localhost config but am getting an error connecting
> to the remote host at www.runrev.com. Does anyone have another remote site I
> could test this with?
>
> 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 "www.runrev.com" into tDatabaseAddress
> -- put "runrev_test" into tDatabaseName
> -- put "example" into tDatabaseUser
> -- put "example" into tDatabasePassword
> put "localhost" into tDatabaseAddress
> put "learnsql" into tDatabaseName
> put "root" into tDatabaseUser
> put "root" 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
>
>
> Also, if your site uses port numbers I'd like to try that as well with
> something like this code:
>
> revOpenDatabase ("mysql",host[:port], databaseName, [userName], [password],
> [useSSL], [socket], [timeout], [autoReconnect])
>
> BTW, the error I am getting at www.runrev.com is
> Host 'wnpgmb014uw-ad04-17-21.dynamic.mtsallstream.net' is not allowed to
> connect to this MySQL server
>
> Thanks
>
> -- Mark
More information about the use-livecode
mailing list