I have a table that has got one A_I column named link_id. When I run like that:
$link_id = 32;
$query1 = "DELETE FROM links WHERE link_id = $link_id";
if(!mysql_query($query1,$connection));
{
die(mysql_error($connection));
}
It works succesfully but when I try this with C# WebRequest:
WebRequest request = WebRequest.Create("http://www.mywebsite.com/deleteLink.php");
request.Method = "POST";
string post = "link_id=" + id //type string;
byte[] postBytes = Encoding.UTF8.GetBytes(post);
request.ContentLength = postBytes.Length;
request.ContentType = "application/x-www-form-urlencoded";
Stream dataStream = await request.GetRequestStreamAsync();
dataStream.Write(postBytes, 0, postBytes.Length);
WebResponse response = await request.GetResponseAsync();
return new StreamReader(response.GetResponseStream()).ReadToEnd();
returns : Unknown column '32' in 'where clause'
Where am I doing wrong? Thanks.