In Search of the Elusive Middleware Example
Posted: Sat Mar 14, 2015 2:43 pm
Actually, the long title of this post is: "In search of a simple example of the elusive PHP middleware example that will allow one to connect LiveCode to a mySQL database that does not allow direct connections"
Almost three years ago I submitted a request for help in figuring how to connect LiveCode to a mySQL database that I use through a commercial web hosting company. I was following this tutorial:
http://lessons.runrev.com/m/4071/l/7003 ... l-database
I submitted my request when I hit my brick wall; here's a link to the thread:
http://forums.livecode.com/viewtopic.ph ... 45&p=57525
I learned from the responses that LiveCode requires a direct connection to the database, but unfortunately this poses a severe security risk, such that virtually all web hosting companies do not allow it. I was assured that it was still possible to do it, but I would need to create what others have referred to as "middleware" - some code written in PHP, for example, that would live on the server with the database that LiveCode could first connect to.
I know a little PHP, but not much. Every now and then, I come back to this problem and spend time trying to figure it out. But, I never get very far. I've done searches in this forum and on google and have found others who seem to be in the same boat - and the same advice is given:
http://forums.livecode.com/viewtopic.ph ... re#p116334
http://forums.livecode.com/viewtopic.ph ... re#p100711
http://forums.livecode.com/viewtopic.ph ... are#p91789
In the last thread, I think "twseid58" expressed my feelings well:
"I searched the forum for 'middleware' and couldn't find much information about how others deal with this. Surely this is something developers work with if they create and deploy a stand-alone LiveCode application that makes use of a MySQL database."
Yes, surely this is something that loads of people have figured out.
My request here is for someone to provide a simple, concrete example of the PHP middleware file and also to show a simple example of how to write the needed scripts in LiveCode to connect to the mySQL database via the middleware file. (The request is really targeted to Kevin Miller and the good folks at LiveCode to create an "official" tutorial on this.)
My motivation for sending this semi-emotional posting is that I've been teaching LiveCode here at the University of Georgia and I now have students who want to use it to connect to their mySQL databases.
And, to be clear, I'm loving every minute I spend with LiveCode. It's just now time for me (and others) to take their LiveCode to the next level to connect to full-fledged databases on the web. (And who are already paying a good chunk of money each month to one - or more - web hosting companies.)
Thanks!
Lloyd Rieber
Almost three years ago I submitted a request for help in figuring how to connect LiveCode to a mySQL database that I use through a commercial web hosting company. I was following this tutorial:
http://lessons.runrev.com/m/4071/l/7003 ... l-database
I submitted my request when I hit my brick wall; here's a link to the thread:
http://forums.livecode.com/viewtopic.ph ... 45&p=57525
I learned from the responses that LiveCode requires a direct connection to the database, but unfortunately this poses a severe security risk, such that virtually all web hosting companies do not allow it. I was assured that it was still possible to do it, but I would need to create what others have referred to as "middleware" - some code written in PHP, for example, that would live on the server with the database that LiveCode could first connect to.
I know a little PHP, but not much. Every now and then, I come back to this problem and spend time trying to figure it out. But, I never get very far. I've done searches in this forum and on google and have found others who seem to be in the same boat - and the same advice is given:
http://forums.livecode.com/viewtopic.ph ... re#p116334
http://forums.livecode.com/viewtopic.ph ... re#p100711
http://forums.livecode.com/viewtopic.ph ... are#p91789
In the last thread, I think "twseid58" expressed my feelings well:
"I searched the forum for 'middleware' and couldn't find much information about how others deal with this. Surely this is something developers work with if they create and deploy a stand-alone LiveCode application that makes use of a MySQL database."
Yes, surely this is something that loads of people have figured out.
My request here is for someone to provide a simple, concrete example of the PHP middleware file and also to show a simple example of how to write the needed scripts in LiveCode to connect to the mySQL database via the middleware file. (The request is really targeted to Kevin Miller and the good folks at LiveCode to create an "official" tutorial on this.)
My motivation for sending this semi-emotional posting is that I've been teaching LiveCode here at the University of Georgia and I now have students who want to use it to connect to their mySQL databases.
And, to be clear, I'm loving every minute I spend with LiveCode. It's just now time for me (and others) to take their LiveCode to the next level to connect to full-fledged databases on the web. (And who are already paying a good chunk of money each month to one - or more - web hosting companies.)
Thanks!
Lloyd Rieber