views:

77

answers:

1

I'm creating a website using PHP and MySQL, and I'm trying to add some Silverlight stuff to the site. I need the users to be able to do stuff in the Silverlight app, and for that data to be saved in the MySQL database. I'm wondering about how I could do this...

Can I get the client side Silverlight app to log in to the server side MySQL database? Would this be a security risk? And if it's possible, how would I do it?

Or is there a better way anyone can think of? And any ideas how I'd implement it?

Thanks everyone! :)

A: 

No you should not have the app interact with your MySQL database directly. In this type of situation you will need to implement some form of web service, which exposes your data to the client. The Silverlight client code will then send requests to the web service, which runs on the server and has access to the database. Using a Microsoft technology on the server will make this a lot easier, because the IDE will do a lot of the wiring up for you, but I'm sure it could be done with PHP as well.

I would look into how to create a PHP, REST or SOAP based webservice and go from there.

Here is a video explaining how to consume the service, once you have that sorted out on the server.

http://silverlight.net/learn/videos/silverlight-videos/http-communication/

James Hollister