facebook

MobiOne <-> PHP <-> MySQL

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 15 posts - 1 through 15 (of 34 total)
  • Author
    Posts
  • #312902 Reply

    macjerem
    Member

    Hello,

    I would like to ask a question abour creating Forms.
    When you create a form, it means you wild like to save data in a database.
    Personnally, I am not interested by a local database, but by a MySQL database, to register data.

    –>
    So when I click on the SAVE button, I will call a new page on MobiOne.
    But, where can I insert the PHP code ?

    –>
    Is it possible to test the MobiOne application on a web server (like EasyPhp) ?

    –>
    Same question if propose the visitor to selec information from a form, to keep data from a database.

    Thanks,

    Jérémie

    #312909 Reply

    Albatros78
    Participant

    Hello Macjerem

    You can try to test the “Form Action URL” proprerties into the form properties to call a php page where you script will be executed.

    You can also modify the JS file generated by mb1, which has the same name of your project.
    Example, if your project is spelled demo, your custom js file will be demo_custom.js

    But here it’s a Javascript file.
    So 2 solutions. Create your script in JS to manipulate your data to the db.
    Other one solution would be to use XMLHTTPRequest inside javascript to call some PHP functions. This one is very powerfull, but not very common and not so popular.

    May be Wayne from Mb1 have more infos, or someone from this forum.

    Hope this helps

    #312925 Reply

    macjerem
    Member

    Thank you for your answer.

    In fact, to read data from a database, I did the following.
    What do you think about this solution ?

    1- create my projet and the different pages on MobiOne

    2- export the projet, and so generate HTML pages

    3- rename all the HTML pages as this exemple : index.html & page1.html by index.php & page1.php

    4- open all the project’s files to modify the name file (in fact only on the jason files I think)

    5- and finally, I go into my php file to insert the php code which read the database.

    Is this a good / possible solution ?
    It seems to function…

    Cdt,
    Jérémie

    #312933 Reply

    Albatros78
    Participant

    May be.

    Need to be tested. One issue is that you can not never modify your project page if you change html by php or even if you add php code into your html page.

    The best, I think, is to use the custom js file to call all functions (JS or PHP into JS).
    Like that your mobi project is not really changed and available to change design. But not sure that if it is always possible to do that.

    Probably sometimes, you need to modify mb1 generated code.

    Hello Wayne, have you some feedback about that ? Any help from you side with mb1 will be appreciate.

    Documentation of mb1 is missing, and it would be very nice to have a very tech doc.

    #312936 Reply

    macjerem
    Member

    ok, it was what I thought.
    I will test and tell you back.

    Put the PHP code in the JS ? … well euh… not sure it can help when you want to write data from a database…

    #312939 Reply

    Albatros78
    Participant

    XMLHttpRequest object

    very very powerfull function to call php from JS.

    Tu sembles être Francais ? 🙂
    est-ce le cas ? Me too also.

    ici un lien inétressant (in french sorry guys)
    http://www.toutjavascript.com/savoir/xmlhttprequest.php3

    Hope this helps

    #312940 Reply

    macjerem
    Member

    >>>>> XMLHttpRequest object
    >>>>> very very powerfull function to call php from JS.

    Merci je vrais regarder ça.
    Mais tout ça c’est coté client.

    Imaginons qu’un internaute sélectionne une valeur dans une combobox, valide, et là je charge une nouvelle page en affichant des données qui proviennent de la Base de données (MySQL par ex), en fonction de la valeur sélectionnée dans la Combobox.
    A quel moment je dois aller chercher les données sur le serveur (base MySQL) ?

    >>>>> Tu sembles être Francais ? 🙂 est-ce le cas ? Me too also.

    Mince, ça c’est vu !!!
    Je savais qu’il fallait encore que je travails mon anglais !!!

    >>>> http://www.toutjavascript.com/savoir/xmlhttprequest.php3

    Je vais regarder ça merci.

    #312941 Reply

    Albatros78
    Participant

    Marcjerem

    I continue in english for another guys in this forum.

    Just 2 things.
    Javascript is ALWAYS executed from client side
    PHP is ALWAYS executed from the server.

    With mb1 application it’s very interesting to use PHP, because there not many ressources on the Iphone. It would be better to use PHP for big function. It’s my opinion.

    And XMLHttpRequest is just a JS function to prepare the PHP call. Your code is executed into your PHP file and the results are sent to client through JS.

    Hope to be clear

    Does anybody has some further infos?

    #312944 Reply

    macjerem
    Member

    Hello,

    Fisrt,
    sorry for my last french message… of course I should have written it in english….

    Albatros78, I just realise,
    of course, you are totally write about using JS !

    Finally, I will keep the HTML files generated by Mobi1 and try to modify the JS.

    And I had forgotten I already used to use the XMLHttpRequest object.
    At this time, I use it to check the pseudo, when somebody subscribes the website (to verify if the pseudo is already used or not).
    And actually it functions very well !
    But I didn’t realise it was what you were speaking about, because I called this doing AJAX, using the XMLHttpRequest object, … isn’t it write ? (I am surprised not to see Ajax in the very interesting link you sent us).

    >>>>>>With mb1 application it’s very interesting to use PHP, because there not many ressources on the Iphone. It would be better to use PHP for big function. It’s my opinion.

    Not sure to understand your sentence.
    Is it interesting or not ?

    >>>>>>because there not many ressources on the Iphone

    You mean not powerfull enough to request a dabase ?

    Albatros,
    do you work for Mobi1?

    Jeremie

    #312947 Reply

    Albatros78
    Participant

    If you can post your login check sample when it will be ready on mb1, it would be very nice for everyone here.

    When I said not enough ressources on iPhone, I says that because it’s a mobile phone and not a PC or serveur with many many memory and CPU’s. Whit PHP your scripts run on the server, and like that your client (iPhone) is free to do other task.

    Obviously you can have a local db on the iPhone, but to be honest it’s a little bit limited. it’s not MySQL or SQL DB… very usefull to have some records locally, but probably not to have 100 000 records ! I think so.

    You can check on this forum. I posted in a zip file few weeks ago a local db sample and how to.

    No I’m not mb1 guy !

    But I follow the product since several weeks and product release, because I found this product interesting. I’m very active on this forum to try to help mb1 team to solve issues & bugs and have a stable version as soon as possible.

    The concept of design is very interesting…

    But no documentation today, and it’s a little bit difficult to undertsand very well how works clearly each component. It’s why I ask to you to post your example of mb1 project when it’s working fine, to help everyone .

    Hope this helps

    #312952 Reply

    macjerem
    Member

    >>>>If you can post your login check sample when it will be ready on mb1, it would be very nice for everyone here.

    Of course no pb !

    But first of all, I want to try mobi1 gradually.
    I mean my first goal is to to propose on the first page a combobox (feeded by a database).
    The visitor select a line, valid, and he arrives on the second page which show a data table which corresponds to the selection of the previous page…

    #313586 Reply

    mikhail
    Member

    Hallo,

    do you have some news about yor “Login check”?

    I’m very intrested in this example!

    Best regards Mikhail

    #314055 Reply

    jspoerer
    Member

    Hello… any news about your App. I´m interested too.
    Would be interesting as an example…

    I was thinking to buy this aplication but without proper documentation we are all GUESSING how it can be used..

    Jorge from Chile

    #314058 Reply

    Albatros78
    Participant

    Personnaly I’m waiting for the next 1.1 version (seems almost ready ….) May be next week..

    This new version would be more accurate regarding web form action and also aothers interessting things…

    And when this new version will be available, I will play again with a login form page and display list items. Results were not very good with actual release..

    #314059 Reply

    jspoerer
    Member

    I will keep an eye on your posts Albatros…

    Thanks

Viewing 15 posts - 1 through 15 (of 34 total)
Reply To: MobiOne <-> PHP <-> MySQL

You must be logged in to post in the forum log in