In my application, a resquest is sent to a PHP server from a C# application. The application sends details the author name via POST. I want the PHP application to query a database and return, ideally, an array of the authors details:
C#
String result = "";
string url = LINK_TO_SITE;
using (WebClient client = new WebClient())
{
NameValueCollection postData = new NameValueCollection()
{
{"Author", Properties.Settings.Default.Author}
};
result = Encoding.UTF8.GetString(client.UploadValues(url, postData));
MessageBox.Show(result);
php
$author=$_POST["author"];
$stmt = $mysqli->stmt_init();
$stmt = $mysqli->prepare("SELECT name, date, code FROM Collab where Members=?");
$stmt->bind_param('s', $author);
$stmt->execute();
$stmt->bind_result($name,$date, $code);
I can retrive the details fine. Now, how will I put the data into an array that can be sent back to C#?
So basically...How do I get a PHP array to work in C#?