none
Connecting to a MySQL database with C# and PHP RRS feed

  • Question

  • Hi,

    I am creating a Windows Phone 8.1 app that I want to use along with a MySQL database to run SELECT queries to retrieve certain data. I've read that the best solution would be to use PHP. I know how to use PHP by itself to run database queries but I don't know where to start when using PHP and C# together to get the query results from a PHP script. Can anyone explain what I actually need to create, e.g. do I need a separate PHP file with the script to run the queries and connect to the database and if so how do I use that in the C# code to retrieve the query results?

    Friday, March 6, 2015 2:21 PM

Answers

  • Hi Joshoowahhh,

    Here is a sample: https://code.msdn.microsoft.com/windowsapps/How-to-connect-Universal-4b4b12bd

    I'm not familiar with php but sounds like php page can accept some variable by GET/POST and also return some data, we can send our data from C# to php address by HTTPClient class and also receive the returned data.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Jamles Hez Wednesday, March 18, 2015 5:45 AM
    • Marked as answer by Jamles Hez Thursday, March 19, 2015 1:25 AM
    Monday, March 9, 2015 2:17 AM