C++ packets into a MySQL database?

This is a discussion on C++ packets into a MySQL database? within the C++ Programming forums, part of the General Programming Boards category; Hi folks, happy weekend A few of us are doing a project and I'm after some advice. Were providing C++ ...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Location
    U.K.
    Posts
    148

    C++ packets into a MySQL database?

    Hi folks, happy weekend

    A few of us are doing a project and I'm after some advice.

    Were providing C++ coded games for people to download and run on their own machine. The games once played are to send the score to our server.

    Using Winsock, the game sends the score in the following format:

    gameID.playerID.score

    These 3 values are of variable lengths, separated by periods, in the form of a string.

    We would like to run a UDP listening service on a LAMP server, but may be forced to use TCP (unsure if this makes much of a difference in relation to my query).

    What I'm after is some advice on how to place the incoming data into the MySQL database.

    Any help is much appreciated!

    Thanks.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    Ignoring the network problem, do you have any idea how to add a fixed record to your MySQL database?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Location
    U.K.
    Posts
    148
    No I don't, I'm looking at using a PHP Split, would you think its a good choice.?

    Code:
    <?php
    list($user, $pass, $uid, $gid, $extra) =
        split(":", $passwd_line, 5);
    ?>

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    What's that got to do with MySQL ?
    That's just splitting a line at a separator.
    If that's your biggest problem so far, then you've got a long way to go.


    http://dev.mysql.com/doc/
    Grab the C or C++ API, study hard and try some simple examples.
    Should take you several months.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. [C#] MySQl database problems
    By Jelte in forum C# Programming
    Replies: 5
    Last Post: 09-26-2008, 03:11 AM
  2. Problem connecting to MySQL Database?
    By MrLucky in forum C++ Programming
    Replies: 5
    Last Post: 01-30-2006, 10:30 AM
  3. About C++ and MySQL or oether free database
    By xxxrugby in forum C++ Programming
    Replies: 18
    Last Post: 12-30-2005, 05:28 AM
  4. Can i use the ASP to access MYSQL database??
    By Frankiepoon in forum Windows Programming
    Replies: 1
    Last Post: 10-15-2002, 02:37 AM
  5. mysql and database
    By frankiepoon in forum Windows Programming
    Replies: 1
    Last Post: 06-19-2002, 08:46 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21