Thread: C++ packets into a MySQL database?

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.

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, 11:30 AM
  3. About C++ and MySQL or oether free database
    By xxxrugby in forum C++ Programming
    Replies: 18
    Last Post: 12-30-2005, 06: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