Jump to content
MakeWebGames

C# XNA help passing things to php?? :S


jaymo

Recommended Posts

I'm kind of a beginner to C#, I know the basics and little bit more and have been learning XNA. I have made a few small games which were very basic. I was just wondering if it is possible to pass information over from a game to say a mysql database? Is it even possible. As I wanted to be able to send scores etc over and retrieve them.

Thanks

James

Link to comment
Share on other sites

Use the mysql dot net connector:

http://dev.mysql.com/downloads/connector/net/5.1.html

Or if you want to use Linq use something like:

http://www.devart.com/linqconnect/

I personally use LINQ exclusively since a year, much faster to develop, safer, and code lot more readable.

Now if you want at any costs to have your C# code "chatting" with a PHP code, I would suggest to make a web service via PHP and call it from C# as C# have a full integrated solution for SOAP. You may want to check:

http://php.net/manual/en/book.soap.php

Link to comment
Share on other sites

In addition to what a_bertrand has said above. Make sure you know what you want to do! From reading the posts title, I get the impression that you want to pass things from the c#/xna code to php. While you speak of connecting to a mysql database in your topic.. These are two different things which have different solutions.

Connecting to a mysql database is rather easy in .net, use the link a_bertrand provided.

Link to comment
Share on other sites

I'm with a_b on that one.

If you are hosting the database server at a remote location, the closest relatives to the database server should handle the communication to the database.

Why?

Assuming you are making a client with C# and the server with PHP, then the client could easily overlook what's being sent over the network.

If you need to have a database on the clientside, I'd suggest a simple Flatfile db, or even access. The client could just periodically send the altered version of the database over to the server. This would, of course, come at a cost: less strain on the server and more secure, but there would be delays on the server side.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...