![]() |
|
[C#] why wont my program register users? MYSQL - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] why wont my program register users? MYSQL (/showthread.php?tid=5725152) |
why wont my program register users? MYSQL - Jopemeister - Sep 26, 2017 why wont this register a user? BTW i know this method isnt safe, this is just a test program https://pastebin.com/tZxQJpVK * - Ninja - Sep 26, 2017 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? * - Rhez - Sep 26, 2017 (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. * - +Haze - Sep 26, 2017 From the query alone, the Id column is empty and possibly wrong data type * - Ixxion - Sep 26, 2017 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" * - abratar - Sep 26, 2017 Why didn't you first try the sql query manually before posting? * - Siy - Sep 27, 2017 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. |