User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22

Thread: Connecting to a MySQL database....?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Connecting to a MySQL database....?

    I have pretty much no experience with php, but is there a way to connect to a database in MMF to login to a game? Could someone direct me to a help file or tutorail? Also, is there a way to create directories on my site in MMF using vitalized extensions? (www.mysite.com/newdirectory)

    If you can answer either of these questions, that would be very helpful.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    Here's a tutorial:

    http://www.clickteam.com/eng/resources/online_score/dxn-scoreboards.zip

    (Though I recommend you use Live Receiver instead of Moosock, the theory is much the same - I promise I will update it to Live Receiver some day even though I've been saying that for the last year.)

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    Like I said, I do not know much php. So if you could explain how to code this, that would be much appreciated.

  4. #4
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    Even for people who have no PHP coding knowledge, the tutorial explains most of the PHP code and you really hardly need to understand very little of it, copy and paste will suffice.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    How did I know you'd be posting a reply, Brandon? Are you following me around? I bet you've caught on to my evil scheme already.

    EDIT: I didn't even notice the files that came with the MMF file. I guess it may be smart to look at them.

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    I'm having trouble checking a user's name with its password for logging in. I know it's simple php, but I'm not sure how to do it. I created a new php file and called it "user_check.php" and I set it to get the username from the url, but how do I compare it to the password on the database?

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    OK. This is what I have in my php file that checks if the user's name and password match:

    Code:
    <html>
    <head>
    <title>User Check</title>
    </head>
    <?
    
    $name = $_GET['name'];
    $userpassword = $_GET['userpassword'];
    
    $service = "localhost";
    $username = "pauliuko";
    $password = "sdfsfsf";
    $database = "pauliuko_games";
    
    mysql_connect($service, $username, $password);
    @mysql_select_db($database) or die( "Unable to select database");
    
    
    $get=mysql_query("SELECT (id) FROM users WHERE name=$user and password=$pass");
    $result=mysql_query($query);
    echo"$result"
    
    
    
    ?>
    
    
    </body>
    
    
    </html>
    If the name and password match, there should be a "1" on the screen, but when I try it, the page is blank. What did I do wrong?

    EDIT: My MySQL table has 4 columns: id, name, password, and datejoined.

  8. #8
    No Products Registered

    Join Date
    Jun 2006
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    your result line is wrong, you're asking another query here :
    $result=mysql_query($query);

    I don't remember very well but isn't it something like mysql_fetcharray ? or something like that ?

    EDIT : found this :

    $result = mysql_query("SELECT id, name FROM mytable");

    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
    printf("ID: %s Name: %s", $row[0], $row[1]);
    }

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    I have no idea. This is my first time ever actually using php and MySQL.

  10. #10
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connecting to a MySQL database....?

    Quote Originally Posted by Corentin
    EDIT : found this :

    $result = mysql_query("SELECT id, name FROM mytable");

    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
    printf("ID: %s Name: %s", $row[0], $row[1]);
    }
    What you found just returns the entire table. What I want is to check if 2 values are the same.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Connecting to a database via flash and mobile apps
    By FrankyAsh in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 17th January 2011, 10:21 AM
  2. ASP.NET to access a mySQL database from MMF2?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 15th September 2010, 08:26 PM
  3. Hi-score and mysql database
    By videogiochi in forum Multimedia Fusion 2 - Technical Support
    Replies: 16
    Last Post: 14th July 2010, 04:10 PM
  4. [REQUEST] MySQL database
    By Dynamite in forum Extension Development
    Replies: 2
    Last Post: 10th March 2010, 05:08 AM
  5. Database: Connecting to a database over internet
    By Ham in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th March 2010, 11:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •