How to use C3 to load text and images from a database

0 favourites
  • 6 posts
From the Asset Store
500 monsters and creatures images for card games - Set 1
  • I intend to create an app with several interactive activities for children. For this I will use some layouts each one for a activity and each should load a image/graphic from a database. The problem is I never create a game that use a db until today and I believe that is better to use a db instead importing text and images to the C3, isn't? So I will need know the basic procedures: which DB to use, how to create this connection (Need I to use a plugin? Can I use a DB in app for mobile devices or just for web?) Could someone help me giving some information about this?

    Thanks in advanced

  • Check out the following URL for examples of this:

    http://simbucket.com/chemthinkserver/ch ... ex.html?as

    In order to do it, you will need a webserver with a database. Most web hosting companies offer a php/mysql package for fairly low cost. I recommend not saving the images themselves in the database. Rather, store them as a file, then store the filename/URL in the database.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Check out the following URL for examples of this:

    http://simbucket.com/chemthinkserver/ch ... ex.html?as

    In order to do it, you will need a webserver with a database. Most web hosting companies offer a php/mysql package for fairly low cost. I recommend not saving the images themselves in the database. Rather, store them as a file, then store the filename/URL in the database.

    Nice cjbruce

    Thanks for the indication. I will check it. I am a Hostgator client.

    Is this project yours? Do you know if I can use this method in the mobile apps? Do you have a tutorial about this? I don't know how to start to use this solution.

  • > Check out the following URL for examples of this:

    >

    > http://simbucket.com/chemthinkserver/ch ... ex.html?as

    >

    > In order to do it, you will need a webserver with a database. Most web hosting companies offer a php/mysql package for fairly low cost. I recommend not saving the images themselves in the database. Rather, store them as a file, then store the filename/URL in the database.

    >

    Nice cjbruce

    Thanks for the indication. I will check it. I am a Hostgator client.

    Is this project yours? Do you know if I can use this method in the mobile apps? Do you have a tutorial about this? I don't know how to start to use this solution.

    The project is entirely my own, though it is a port of a flash-based version written by another teacher.

    It is set up in two parts:

    1. A Construct 2 client - This exists on the user's device, and runs a big Construct 2 project. The C2 project makes AJAX requests to the server.

    2. A php server running a mysql database - This consists of an Apache server which runs php scripts that I wrote. The php scripts contain database calls to the mysql database. All user information is stored on the database.

    This method also works in mobile apps. I used to include ad requests to my own ad server. All you have to do in C3 is make a GET or POST request to the server from the C3 project via AJAX.

    As far as getting started goes, I will try to put this in another reply.

  • To get started, I recommend searching for "php" in the Construct 2 tutorials. Here is one that has the basics:

    https://www.scirra.com/tutorials/4887/tracking-your-users-with-ajax-php-and-mysql

    Keep in mind that these tutorials may have been written for an outdated version of php. php has gone through some major changes in the past four years to address some security vulnerabilities, so you will need to go to php.net to read through to see what is new.

    It is also possible to set up all of your database tables entirely within phpmyadmin. When I was first learning, this was much more intuitive than starting with raw mysql code. Once the tables are set up, you can write php scripts that contain mysql code to create/read/update/delete.

  • The project is entirely my own, though it is a port of a flash-based version written by another teacher.

    It is set up in two parts:

    1. A Construct 2 client - This exists on the user's device, and runs a big Construct 2 project. The C2 project makes AJAX requests to the server.

    2. A php server running a mysql database - This consists of an Apache server which runs php scripts that I wrote. The php scripts contain database calls to the mysql database. All user information is stored on the database.

    This method also works in mobile apps. I used to include ad requests to my own ad server. All you have to do in C3 is make a GET or POST request to the server from the C3 project via AJAX.

    I will give it a try, but I think it will be almost impossible according with my knowledge

    [quote:1vmgm48f]As far as getting started goes, I will try to put this in another reply.

    Thank you! I will really appreciate that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)