212 posts
Location
Leeds, England
Posted 18 December 2012 - 07:36 AM
Hey guys does anyone know if theres an SQL Api availible or at least a close port of LuaSQL floating around somewhere for Computercraft?
I need to be able to connect to and modify a MySQL Database for a project I'm working on…
If not then are there any other ways to do this through 3rd party like PHP using the HTTP API? and if so then couls someone be kind enough to explain to me how this is done?
Thanks
~NDFJay
1619 posts
Posted 18 December 2012 - 07:49 AM
Hey guys does anyone know if theres an SQL Api availible or at least a close port of LuaSQL floating around somewhere for Computercraft?
I need to be able to connect to and modify a MySQL Database for a project I'm working on…
If not then are there any other ways to do this through 3rd party like PHP using the HTTP API? and if so then couls someone be kind enough to explain to me how this is done?
Thanks
~NDFJay
http://www.computercraft.info/forums2/index.php?/topic/5433-cc-142-147-ccmysql/
212 posts
Location
Leeds, England
Posted 18 December 2012 - 08:10 AM
I saw this but the problem I have is I dont want to use additional mods/peripherals as this is a public release project and not everyone will have the mod, and other prerequisits to use the program…
thanks anyway though ^_^/>
~NDFJay
1054 posts
Posted 18 December 2012 - 08:58 AM
Well, CC can only connect on ports 80 and 443 while MySQL is on port 3306. So I believe that your only option is to use HTTP API + an php interface. If you don't mind about security, you can just directly run post data from CC as sql queries on the MySQL database. I would never do that myself though.
Edit: After rereading that you want to make this public, don't directly run queries, just make a proper php interface for all information that you need and let php handle the mysql database.
212 posts
Location
Leeds, England
Posted 18 December 2012 - 11:22 AM
Well, CC can only connect on ports 80 and 443 while MySQL is on port 3306. So I believe that your only option is to use HTTP API + an php interface. If you don't mind about security, you can just directly run post data from CC as sql queries on the MySQL database. I would never do that myself though.
Edit: After rereading that you want to make this public, don't directly run queries, just make a proper php interface for all information that you need and let php handle the mysql database.
I thought that would be the case, im basically taking the google os approach and storing user data on my server and introducing full cloud computing into my OS thats why I was querring SQL… I dont know enough about PHP to even think of where to begin… you dont happen to know where I can find some tutorials on how to set this up do you? I want it to be as secure as possible so I really need some help if im taking the PHP approach…
Thanks
~NDFJay
7508 posts
Location
Australia
Posted 18 December 2012 - 11:34 AM
Only other thing I could suggest is use the HTTP API to GET a raw jsp or asp page that gets generated by your web server and database connector. I wrote something similar to this when I was studying Database Programming this semester at uni.
212 posts
Location
Leeds, England
Posted 18 December 2012 - 11:52 AM
Only other thing I could suggest is use the HTTP API to GET a raw jsp or asp page that gets generated by your web server and database connector. I wrote something similar to this when I was studying Database Programming this semester at uni.
Getting files and using file generation isnt the hard part, its storing data to the server that I need to do and im going to be honest. im struggling
Thanks anyway guys, looks like im going to learn PHP :)/>
1054 posts
Posted 18 December 2012 - 12:07 PM
Only other thing I could suggest is use the HTTP API to GET a raw jsp or asp page that gets generated by your web server and database connector. I wrote something similar to this when I was studying Database Programming this semester at uni.
It's really the same thing. Server side scripting language generates page content by querying the database and CC grabs it.
@NDFJay: I'll look into some tutorials for you later, I'm busy now. :)/>
212 posts
Location
Leeds, England
Posted 19 December 2012 - 02:53 AM
Only other thing I could suggest is use the HTTP API to GET a raw jsp or asp page that gets generated by your web server and database connector. I wrote something similar to this when I was studying Database Programming this semester at uni.
It's really the same thing. Server side scripting language generates page content by querying the database and CC grabs it.
@NDFJay: I'll look into some tutorials for you later, I'm busy now. :)/>
Thanks man, i Highly appreciate it :)/> ive not been able to find any myself, well not any good ones anyway…