A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 30

Thread: KM & MySql

Hybrid View

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702

    KM & MySql

    Here is my issue:
    I need to load different information on same frame of my movie depending on which button is pressed on a page. The reason is, so I don't have to make the movie any bigger than it has to be. It's also so that updates to the site are as simple as adding a new player button.

    Ok, I'm not worried about filling in the MySql table with Data for now. I can do that manually (for now). How do I set up the button to call information from the database.

    Here are the items I need to call from a database into my movie.

    Player Name = txt1
    player image=txt2 (can I even present an image here?)
    member since=txt3
    awards=txt4
    clanrank =txt5 -Same issue as with player image.

    I'll add more information later but if I can learn to pull out this information, I can make the updates later.

    The user will click on a button that button will load that specific player's information into the data fields.
    ----------NOTE --------------
    I've already tested Chris' SQL_Menu2 but it doesn't work. I think there's been a change to the syntax. I even had to update the syntax on the .sql file just to insert the information into the database.
    But I am still looking into it's code.
    ------------------------------
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  2. #2
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    OK man...cut it out.

    You know they tested all my stuff before approval. I just downloaded both fresh. Dumped the sql with phpmyadmin, edited the common.php files with my connection info and here they both be:

    http://flex.hobby-site.com/examples/...SQL_Menu1.html
    http://flex.hobby-site.com/examples/...SQL_Menu2.html

  3. #3
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I finally decided on a portal for my site. Anyone needs help with my KM stuff...feel free to stop by. I'll get the forum up (nothing fancy, just the facts). Better than dumping issues with my stuff on the KM forum (it was never really suggested even when I was current here). This keeps Bob focused on his app and not having to deal with my baggage.

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    LOL, I knew this would bring you out.

    But kidding asside, here is what happens when I dump the SQL_Menu2.sql file
    Quote Originally Posted by phpmyadmin
    Error

    SQL query:

    --
    -- Table structure for table `sqlmenu_2`
    --
    CREATE TABLE `sqlmenu_2` (
    `id` int( 11 ) NOT NULL AUTO_INCREMENT ,
    `name` varchar( 25 ) COLLATE latin1_general_ci NOT NULL ,
    `target` varchar( 100 ) COLLATE latin1_general_ci NOT NULL ,
    PRIMARY KEY ( `id` )
    ) ENGINE = MYISAM DEFAULT CHARSET = latin1 COLLATE = latin1_general_ci AUTO_INCREMENT =6;

    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate latin1_general_ci NOT NULL,
    `target` varchar(100) co
    Then I modified the common.php
    Code:
    <?php
    
    $hostname_PD = "localhost";
    $database_PD = "dniezby_koolmoves";
    $username_PD = "dniezby_km1";
    $password_PD = "XXXXXX";  // Obviously, I removed my password
    $PD = mysql_connect($hostname_PD, $username_PD, $password_PD) or trigger_error(mysql_error(),E_USER_ERROR); 
    ?>
    Then uploaded the html, swf, common.php,SQL_Menu2.php to my server.
    And this is what I get.
    http://www.nssclan.org/km/menutest/SQL_Menu2.html
    ------------- Server Info -------------
    MySQL client version: 4.1.10
    phpMyAdmin - 2.9.0.2
    Server version: 4.0.27-standard
    Protocol version: 10
    Server: Localhost via UNIX socket
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Here is the modified SQL_Menu2.sql code as phpmyadmin listed in my version.
    -
    -- Table structure for table `sqlmenu_2`
    --

    CREATE TABLE `sqlmenu_2` (
    `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `name` VARCHAR( 25 ) NOT NULL ,
    `target` VARCHAR( 100 ) NOT NULL
    ) TYPE = MYISAM ;


    --
    -- Dumping data for table `sqlmenu_2`
    --

    INSERT INTO `sqlmenu_2`( `id` , `name` , `target` ) VALUES ('1', 'Home', 'home'),('2', 'Our Products', 'content'),('3', 'Contact Us', 'contact'), ('4', 'Featured Links', 'links'),('5', 'About Us', 'about');
    NOTE: THIS IS FROM MY VERSION OF PHPMYADMIN
    Last edited by dniezby; 12-19-2006 at 11:59 PM.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  6. #6
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    See post #3

    I'm on phpmyadmin 2.9.0.1. Dumped fine even with the commented lines (you may have to remove them because some versions are picky). phpmyadmin created that dump. As for the backends in ALL my MySQL stuff you have to replace

    if (!$result) {
    fail("No database");
    }


    with

    if (!$result) {
    //or some other error that displays a message
    exit;
    }

    "fail" is a function I use locally that slipped by in all my submissions.

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Wow, could they really have made that much of a change between versions?

    I just replaced the above code into your SQL_Menu2.sql file (left in the comments for testing purposes).

    It dumped wonderfully.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  8. #8

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    You'll see where I want to display this info by visiting the site
    http://www.nssclan.org

    Then click the Folder on the right. - yes, it will say that "Feature not available yet".
    Once the folder is open, Click on the player name, Shadow_Viper1...This is where the specific information will eventually be presented.
    How to present it, still escapes me.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  10. #10
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    LOL...ok...how can I put this.....

    I'm not sure what is more frustrating. The fact that after seeing this post sit here, since it's focused on my code (or spurred by it), and ending up having me feeling bad that users of my code are out there swinging which ultimately resulted in me installing a forum module to answer these questions that for some reason you are not taking advantage of....OR....the fact you are using the wrong example to learn from.

  11. #11
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Have you successfully gotten the info in from the database now?

    Are you using Chris's menu code to generate the list of users?

    Knowing your data structure and query would help me answer

  12. #12

  13. #13
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Quote Originally Posted by Chris_Seahorn
    He's all set.
    Good, I was confused as his last post he still sounded like he didn't know what to do to present his data.

  14. #14
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Yeah, what he needs we don't really have an example of so I'm going to make him a basic one that gets him going. Just something that he can build upon. He'll most likely be by to confirm (I think).

    For what it's worth....anyone else trying to setup inbound/outbound MySQL with KM would be better served to dissect my forum submission (and it's backends) since that sends data both ways using the two common methods (loadVariables and loadVars). The menu examples are only inbound.

    EDIT:

    I should explain a bit better. By "inbound" I mean the flash frontend simply makes a call to a backend that sends in data that is fairly static. The data is always the same. An example of an outbound/inbound menu would be if I coded a cms that stores a permission level in the table with the menu data. The flash frontend would not only make a call to the backend for the menu but would also POST the permission level (just for instance). The backend would then send in whatever menu items meet the criteria...thereby making it relational to what was POSTed. Whatever your rank is decides what you see on the frontend.

    Dniezby needs to POST out a username and retrieve that users stored information. A classic outbound/inbound these days handled with a sendAndLoad loadVars.

  15. #15
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    sounds like you have him covered then

  16. #16

  17. #17
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Ok man...now that you are all set you know the rule on my stuff like this. What I make for one, I make available for everyone. I'll be submitting this to the Exchange for anyone in need. You'll want this version too since it is slightly different from the one I sent you yesterday.

    Submitting now.

  18. #18
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    What's going to be the name of the submission?
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  19. #19
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Section: MySQL
    Name: Account Listing and Retrieval
    ZIP: PD_ClanUsers.zip

    I mentioned in the description that your request was the reason it was built.

    Why?

  20. #20
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Just so I know where to find it.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center