Right now I'm making a game in C# but also using a database for registering and logging in.
I was wondering if there was a better way to check log in credentials and see if a username / email address has been already taken via registering with another member. Right now I'm just reading all of the database rows (Username & Email) and making them a lower case string and comparing it to the Email address inputted as well as the Username. Both email and username from the database as well as the inputted information have been converted to a lower cased string.
Is there a better way to check the database for certain information rather than running through all of it to check?
Please do not move this thread to public. I posted it in the team section for a specific reason.
Results 1 to 15 of 15
Thread: Database Help
- 13 Aug. 2010 04:07am #1
Database Help
- 13 Aug. 2010 04:19am #2
- 13 Aug. 2010 04:20am #3
- 13 Aug. 2010 04:22am #4
Yea. Make the page the man in the middle basically. Make the page get the info from the database then have it pasted on the page in some sort of order and have your program read that. Kind of like the LG auth.
- 13 Aug. 2010 04:24am #5
Isn't that kind of risky though? Is there a way to do it like Gaia. For every user that registers it creates like there own little database within the database (Tables?) and in the URL of the page like GSI it would only call out a specific ID for that user?
I really know nothing about a database except that I can use it to store information on users, set information, etc etc.
- 13 Aug. 2010 04:27am #6
Well its kind of hard to explain in just a few sentences and im to tired to get in depth. But ill try.
Inside a database are tables. And the tables are organized by columns. In each row is stored data. And thats pretty much it. When i get back home ill show you some stuff on tv or something.
- 13 Aug. 2010 04:43am #7
Just gonna post this here so we don't have a mass of people saying what I've already went over.
If there is any problem Matt just tell me and I'll remove it.
Chad says:
*Just wondering if I could do it that way
*create a database, in that database the user registers and it creates a table. in a table it can store all their information. Username, password, email, gold, etc
*and is there a better way to check the database rather than just running through all the tables and such
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*in gaia the ids your talking abou\t they are using sessions for each different time you login
*whcih is a php only thing
*no
*create a database
*create a table
*user registers and enters a row into the table
*each column represents something different
*username
*password
*gold etc
Chad says:
*):
*I wanted to try my way
*oh well
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*and in php i believe (been over a month since iv touched it)
*there is a function that allows you to see if the returned mysql table contains such and such in such column and such
*php.net
Chad says:
*I know
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*so do that
Chad says:
*I can read all the columns even specific ones in C#
*I dont like using a man in the middle
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*why not?
*its the easiest and safest way
Chad says:
*Is it?
*Why not just create a C# Server and have it return data to the users the same php would
*just packet sending back and forth
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*otherwise you are putting the database info into the program
*where people can read that
Chad says:
*and then thats unsafe to send packets back and forth
*Man in the middle it is!
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*i guess that would work to if you want to run it constantly none stop and have it port forwarded
Chad says:
*But how come I can't create a specific table for a specific user
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*if you wait till monday or sunday night i can prob make you a page for it
*because thats not how databases work
Chad says:
*but its how they could work.
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*not really
Chad says:
*Mean look at it.
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*its really hard to explain but it just doesnt work
*you would be wasting to much space if you did manage to get it trk
Chad says:
*instead of having about a gizzilian columns for one user, Gold, items, friends, avatar, username, password,email, and all the other BS we could have it store all that in a table thus being easier to grab the information.
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*and it would force you to type out a lot of manual mysql commands rather than using the php functions for it pre-build
*....
*you would still ahve the columns!
Chad says:
*I know but it would be way more organized.
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*not really.
Chad says:
*why not?
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*it would be a huge mess of tables
*a table takes up a ton more space than a column in a single table
*you CAN have seperate tables for different groups of things like
*gold and items in one
*then username password in another
Chad says:
*well thats where the tables come in
*instead of storing all the shit in different tables and making a giant mess, each user gets there own table containing all of their information.
*It would make finding data easier.
matt.joseph.smith@gmail.com (E-mail address not verified) says:
*no it wouldnt
*you need to talk to arti
*he would explain it better
Chad says:
*he wont respond
- 13 Aug. 2010 05:21am #8
I dont mind. I think posting that is a good idea actually.
EDIT::
If you can wait till sunday or monday i can probably make a page for you and comment it explaining it all. Ill make the database and all and send you it.
- 13 Aug. 2010 05:49am #9
- 13 Aug. 2010 05:55am #10
- 13 Aug. 2010 06:01am #11
I still haven't figured out how I want to do it. I'm thinking of having two separate tables. one for accounts the other holding information on those accounts. Idk, you make the database.
- 13 Aug. 2010 11:57am #12
I can't be bothered reading that conversation. You should be able to interact with some form of SQL database in .NET. Just do some research.
- 13 Aug. 2010 10:45pm #13
I don't want to make a database in .Net though. That seems extremely retarded plus I probably wont have my computer running 24/7 so I want it to be a database on a hosting service.
- 14 Aug. 2010 12:59am #14
- 18 Aug. 2010 02:16am #15
too long to read.
If it's a online game, keep your DB server sided. If it's offline, no need to have DBs other than in the client's PC. Using MySQL is fine, there are other DB libraries you could use. In the case of MySQL, you can create multiple key columns. One for Username, one for Email, and one for ID. If the username or email already exist, then an error is going to be returned when you try to insert a an already existent user/email.