Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

why wont my program register users? MYSQL

why wont this register a user?
BTW i know this method isnt safe, this is just a test program


https://pastebin.com/tZxQJpVK
[Image: YFNJZfM.gif]
Are you getting any errors? Did you try debugging to see if the code you want gets executed (correctly)? Did you catching and displaying the exception that got thrown?
(Sep 26, 2017 03:45 AM)Ninja Wrote:  Are you getting any errors? Did you try debugging to see if the code you want gets executed (correctly)? Did you catching and displaying the exception that got thrown?

No, he's just putting this "Exception ex" without using it.
Op, try to debug it and edit the post with errors.
From the query alone, the Id column is empty and possibly wrong data type
Code
INSTERT INTO users (id, naam, password) VALUES ('', '{user}', '{pass}

Not sure if this is how you say it in your language, but I've never seen anyone do SQL in another language. Should be "INSERT"
Why didn't you first try the sql query manually before posting?
First of all it is 'INSERT' and not 'INSTERT'.

If you're using XAMPP/WAMP i think the server should be 'localhost' instead of '127.0.0.1' (dont quote me on this one)

and since you're not inserting anything into 'id' anways you can just skip that in your query and use:
Code
$"INSERT INTO `users` (`naam`, `password`) VALUES ('{user}', '{pass}');"

if you think there is a problem with your query do the following:
Go to PHPMYADMIN -> select your database -> select your table -> click the [SQL] button -> click the [INSERT] button.

A query will be generated. Copy and use that.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by FooterAug 17, 2019 12:02 PM 5 232 Aug 17, 2019 12:02 PM
Last Post: Fhack
[Python] by SilentDec 11, 2016 12:51 PM 3 178 Dec 11, 2016 12:51 PM
Last Post: Silent
[Shell] by Mr KakeFeb 4, 2016 10:33 AM 8 243 Feb 4, 2016 10:33 AM
Last Post: jahwi