connecting to MySql

Ralph DiMola rdimola at evergreeninfo.net
Mon Oct 1 12:27:12 EDT 2012


I connect directly to a MySql db using my account on the on-rev.com server
and have had no problems.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net

-----Original Message-----
From: use-livecode-bounces at lists.runrev.com
[mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Mark Schonewille
Sent: Saturday, September 29, 2012 2:05 AM
To: How to use LiveCode
Subject: Re: connecting to mysql

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


_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list