Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

LSL <-> MySQL

Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
02-13-2009 16:01
Is there any way, short of sending an HTTP request to a web server, to query a MySQL database directly? I'm caning my web server at times because I'm having to use PHP to process a database in order to pass data back to my media players.

My playlists are stored in a MySQL database, rather than a notecard, which makes them REALLY easy to update after they've been bought, and when a URL becomes invalid, for whatever reason, I can automatically remove it from everyone's playlist until I resolve the issue. I just wish I wasn't hammering the web server, when the database server is sitting idle for huge amounts of time.

If it's not possible now, does anyone know if it's in the pipeline? And if not, why not dammit :D
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-13-2009 17:22
Not that I know of. Also, if you're considering putting your database server right on the open network like that, you might as well put a second small web server on it to serve as at least a shallow layer on top of your database. That really shouldn't create much more of a bottleneck than you would have without the web server.
Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
02-13-2009 17:28
I'm not 100% sure I understand what you mean. Why would I need another server?

The system that I'm using is fairly secure, in that every request has to be formatted correctly, and usernames and passwords need to be passed too, so unless someone disected my code, which I hope they can't, then they should never work it out, what with the SL server being the one that connects, and not the client system. I can restrict it to only SL servers too
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Sheryl Mimulus
Registered User
Join date: 5 Aug 2008
Posts: 7
02-15-2009 22:27
There is no way for you to communicate directly to a MySQL server from a LSL script. The only two (tightly controlled) ways of communicating with the outside world are through HTTP requests and emails. Neither are supported by MySql as a means of communicating with the database.

Besides if you're using a PHP framework such as Cake, the php layer is extremely easy to write.
Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
02-16-2009 20:52
Framework? I'm writing my own PHP, which is easy enough :D I just figure that in bypassing PHP you remove reliance on an extra layer, which in theory makes it less reliable. But it's not a problem for me to do.

Shame there's no llMySQLConnect, llMySQLQuery or anything like that, but never mind
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
02-17-2009 01:08
needs php to reelay SLScript`s HTTPprequests to a Mysql database and back.
Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
02-17-2009 02:24
From: Ollj Oh
needs php to reelay SLScript`s HTTPprequests to a Mysql database and back.

What is that in relation to? Are you answering a question?
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
02-17-2009 04:52
From: Landing Normandy

Shame there's no llMySQLConnect, llMySQLQuery or anything like that, but never mind


lol wouldn't that be great!
Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
02-18-2009 19:14
From: Landing Normandy
Shame there's no llMySQLConnect, llMySQLQuery or anything like that, but never mind


Oh, if ONLY!

Heh, stick it in the JIRA - it might come up for review sometime over the next decade
[lolol]

Cherry
_____________________
=================
My stuff on XSt:-
http://tinyurl.com/383mgh
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
02-19-2009 12:48
From your description it would appear that, to the user, the data is read only, in which case you don't really need a database. have a look at http://sites.google.com/ and in particular the 'File Cabinet' page type. You will be stuck with the 2K data limit of the HTTPRequest in LSL, but you could populate a large list in only a few calls, and the service is free with no traffic to your own web site.
Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
02-19-2009 21:12
Thanks. I actually have unlimited webspace and bandwidth with my host, so there's no worry about those things. I used Yahoo Pipes at one point, but they blocked me in the end because of the load that I was putting on them, ha ha. I can deal with it myself quite easily on my site.

The reason I use a database is so that I can quickly add, delete or modify media URLs (mainly YouTube ones). If a URL stops working then it becomes disabled in the database. I can then go in and see which ones are not working any more and attempt to resolve this by finding alternatives. In this respect a database is a godsend for me, as I don't have to FTP in to change files when something changes
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building