i’m not able to pass my ip address as an input to my database in mysql using c#
my code:
string Query = ("SELECT mobile FROM UserDetails where machine_ip=" +ipaddress);
It works fine if the is a string that looks like this: “1234567890”
but doesn work if it looks like this: “127.0.0.0”
Try this:
Also, you should consider using parametrized queries to avoid a SQL injection vulnerability, if this is end-user-facing code.