Page 2 of 4

connect to mysql database

Posted: Mon Apr 14, 2014 1:52 am
by Illya Stepanov

Hi Simon,

As Paul Birch said you should have a REST service not only a mySQL database.

And here is one way - implement it on your server.

When you have REST API you could done all what your API permits. (query data, change it etc..)

Regards.


connect to mysql database

Posted: Mon Apr 14, 2014 4:38 am
by Paul Birch6806546

Let me share how I got my php/mysql site working with appery.io.

There are really only 2 options that I've seen :

RestSQL is a reputable opensource project that will do the job. For my tastes and skill level, had too many install variables to consider = install headache.

I prefer ArrestDB on GitHub. Works on Apache or IIS equally well. This API setup pretty quickly, and provided basic access to the mysql db out of the box. Understand though that the freeware version, won't support a multi-variable search like ?where + doesn't have a built-in security key.

A little $$ tot he author though yielded a customized version of the API that adds the key and handles the ?where and now does exactly what I want.

It's not a perfect API (security considerations) but failing my ability to write an API for myself and/or hire an API writing team and/or spend $2,500/year .... works for me, for now, and has allowed me to complete my app using appery.io (which I have become a big fan of).

Hope that helps.


connect to mysql database

Posted: Mon Apr 14, 2014 6:24 am
by Kateryna Grynko

Hi Paul,

Thank you for sharing this, it's very good example.


connect to mysql database

Posted: Mon Apr 14, 2014 8:23 am
by Koning Voetbal

Hello,

Thx everyone for answering!

I have searched also and came with the following solution with the SLIM rest-api :

http://www.androidhive.info/2014/01/h...

I have download and install this rest-api, the only problem that I'm now having is that SLIM (and most rest-api's) needs PHP 5.3 and I have PHP 5.2.17 on our server so I need to upgrade our PHP version to go a step further ........ ;-)

But it looks like a piece of cake to get this api to work but at this point I'm not absolute sure of that.

Kind regards,

Arie


connect to mysql database

Posted: Mon Apr 14, 2014 8:57 am
by Kateryna Grynko

Hi Arie,

Let us know about your results :)


connect to mysql database

Posted: Mon Sep 01, 2014 9:14 am
by Koning Voetbal

Hello,

Finally I've got PHP upgraded to 5.3 ............ ;-)

I have this SLIM rest API working, I've been testing this in the Chrome Advanced REST client extension and everything looks allright.

But now the big question, is there a tutorial to explain how and where I must use the URL to make this API works in Appery?

I used for example http://www.wijhoudenvanvoetbal.nl/res... to make a registration but how do I use this URL in Appery?

Kind regards,

Arie


connect to mysql database

Posted: Mon Sep 01, 2014 11:39 pm
by Yurii Orishchuk

Hi Koning,

Please take a look how to add parameters to URL:
http://devcenter.appery.io/documentat...

In this document you can found all information how to use services.

Also please don't forget use appery.io proxy http://devcenter.appery.io/documentat...

Regards.


connect to mysql database

Posted: Tue Sep 02, 2014 12:13 pm
by Koning Voetbal

Hello,

tnx for the link, I'va been looking into this one too ......... ;-)

I still got an error back when testing:

Required field(s) name, email, password is missing or empty

{
"status":"400 Bad Request",
"url":"http://www.wijhoudenvanvoetbal.nl/res...",
"response":{
"error":true,
"message":"Required field(s) name, email, password is missing or empty"
}
}

Under the tab Settings, the method = POST, data-type and content-type = JSON. I use the Appary.io proxy

Under the tab Reeust I have the columns, name, email and password with the value {name}, {email} and {password}. All of them are strings and no header selected.

Under the tab Response I have id and name

What is going wrong about this settings?

Kind regards,

Arie


connect to mysql database

Posted: Tue Sep 02, 2014 12:27 pm
by Maryna Brodina

Hello!

Could you post a screenshot from Service Test tab?


connect to mysql database

Posted: Tue Sep 02, 2014 12:35 pm
by Koning Voetbal

Hi Maryna,

Here's the screenshot:

Image