This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KeefKalif's profile picture

Mysql

Started by KeefKalif, 27 February 2012 - 12:31 PM
KeefKalif #1
Posted 27 February 2012 - 01:31 PM
is mysql connection possible?
http://alacner.com/pro/lua-mysql/
Casper7526 #2
Posted 27 February 2012 - 05:38 PM
No
Espen #3
Posted 27 February 2012 - 06:37 PM
You could set up MySQL with e.g. PHP though and interact with that via ComputerCraft's HTTP-API.
This way you can send it commands, which the PHP-Server then interprets as per your predefined instructions and then executes MySQL-Queries on your behalf.
Keep security in mind though, or else you're going to open a can of worms. At least potentially. :D/>/>
Casper7526 #4
Posted 27 February 2012 - 06:48 PM
This is why I hired you, man I didn't feel like typing all that.
MrSherenai #5
Posted 28 February 2012 - 06:53 AM
Had the same Question as Clueless, But i thought that the HTTP API only allows downloading content. How can I fire an event with different arguments?
MewK #6
Posted 28 February 2012 - 07:49 AM
Had the same Question as Clueless, But i thought that the HTTP API only allows downloading content. How can I fire an event with different arguments?

Just pass them as GET-parameters: http://mydomain.com/mysql.php?select=bla&from=blup&where=bla>0
In your script you should use pdo-prepared-statements to handle SQL-injections.
And think about url-encoding. A where clausel like "bla = 'blup' and foo + 3 > 10" has to be escaped or encoded with something like base64.
Liraal #7
Posted 28 February 2012 - 05:40 PM
Had the same Question as Clueless, But i thought that the HTTP API only allows downloading content. How can I fire an event with different arguments?

Actually, clueless's not a nickname, it's a rank. just saying :D/>/>
Kolpa #8
Posted 10 April 2012 - 04:42 PM
im working on an email system using this but i run into a problem that when u read the mails over php i want to get the name of the sender the entry id and the text im using a scipt to split the string that the php page throws out my problem now is that i cant read multiple emails but just one. i u want please look over the code and suggest ideas :P/>/>

PHP: http://pastebin.com/ApXVQY0k

L
UA: http://pastebin.com/hzMPMEPL