Cgimler's Forum Posts

  • 6 posts
  • Hi hundredfold ! thanks for checking up on me! I'm finally back from work, so I'm going to try to work on it again, I was realizing that the webhost I was using wasn't going to allow me to edit certain php files so the connection will work, so I'm going to try getting it to work on my local computer, and we will see how it goes, I'll let you know, thanks

    hopefully everything will go smooth as I think I've come to figure out the basics, but I might need some help here soon!

  • So actually the php file I made isn't connecting because of a code error ) to it telling me this error...

    <br />
    <b>Fatal error</b>:  Call to undefined function mysql_connect() on line <b>4</b><br />[/code:wef7s8d0]
    
    so there might be issues with my webhost, so now, I'm going to try getting it to work with XXAMP on my local computer... I guess :/
  • Thanks again hundredfold I add that to my php file just to be safe and see if it works! I did plan on making different groups but I didn't think I would put the same scores in the same table, rather make two separate tables, but that might be a waste a time, I guess I'll just figure it out on the way through it all haha!

    At this point I'm gonna try to continue figuring this out as I go along, I do appreciate all your help so far, if I have any other questions I'll give you a hollar, but hopefully I won't have to

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks so much for the feedback and tips hundredfold, I've managed to get somewhere but not to the finish line yet unfortunately. Once I get this down I'm pretty sure I'll have Mysql all figured out

    I have some code already that I've put together based off of what I've read on tutorials around the web. (At point you might notice something I inputted incorrectly I'd appreciate it if you'd let me know )

    Code #1: The creation of the table that stores all the scores

    CREATE TABLE ATotalPoints (
    total_points DECIMAL(12,2) NOT NULL DEFAULT 0.00
    ) ENGINE = MYISAM DEFAULT CHARSET = utf8;[/code:2v4mg3v0]
    
    *I have a weird feeling that the line with "total_points DECIMAL..." is wrongly coded but I'm not entirely sure, based off of the knowledge I've received. And actually the rest of the creation code I'm skeptical about, but when I put that code in the myphpadmin, it successfully created a table, below is a picture of what the results :O
    
    [img="http://i62.tinypic.com/jqkihk.png"]
    
    So then I'm assuming the table creation process is complete, I went to my webhost to create a php file that posts the score that the player posts, which the code is below (for security I blocked out my server information  )
    
    [code:2v4mg3v0]<?php
    $score = $_GET['score']; 
    $con = mysql_connect("*****","*******","******");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
      
      mysql_select_db("ATotalPoints", $con);
      
      mysql_query("INSERT INTO ATotalPoints (score) VALUES ($score)");
    
    mysql_close($con);
    ?>[/code:2v4mg3v0]
    
    So then I saved  the php and placed it with my game files on my webhost, then went to construct and where the player can submit the score, I inputted the request for AJAX to use the php, below is what it looks like-
    
    [img="http://i61.tinypic.com/2l28a1.png"]
    
    Then from what I believe, I would then be able to export my game to my webhost, go the point where I'd post the score. I didn't get any errors from the game about the request for posting, but then once I went to my table to check if the score was posted, it says the same thing as the beginning, or would it even show me there? I know I still have the process of requesting the sum score of everyone combined, but right now I'm trying to figure out on just the posting part... HELP
  • Thanks for the reply hundredfold, so from what your saying is that I need to set up a mysql database right? I tried last night to set it up where AJAX calls a number from a php file which is located with the game's files on my webhost, but no avail. So I will try what you said and see if it works! I'm going to get started on it now trying to set it up, but I'm a beginner at mysql databases so I'm still trying to familiarize myself with the coding, if you have any example pages and coding I could work off of I would greatly appreciate it, if not I will begin the quest of trying myself

    Thank you!

  • Okay so I'm trying a different type of game where users will work together with others who use the app, while only playing alone actually.

    So let me try to explain it,

    A single person will click a button on their screen to add points. Once the person is ready to cash in those points, a plugin (after research I assume I'd be using something like AJAX or XML) will post the players cashed in points to a number stored which gathers all points collected by everyone else who has used the app. Basically making it a team effort to build this number up as high as possible.

    So, is this possible? I would hope it would be, but then I think of all the errors that could come out of it, like people posting at the same time and maybe messing up the total number, I'm not sure or the system would wait until the first person's number is added before the next, it's very complicated which therefore is difficult for me to explain.

    In summary, I am trying to figure out if it is possible to have a number stored somewhere (on a file of course that would be linked to a URL), that Construct 2 can access that number and add to it the points the player is cashing in, and making the total now higher, and everyone who contributed can now see the new point total.

    I am stumped and didn't seem to find a tutorial that explained my situation, probably because my situation is rather complicated, any help is appreciated

  • 6 posts