Register user doesnt work (MySQL)
Hey, im new to databases and just wanted to learn how to work with them. But every time I regsiter a new user a new line is added to my table but "user" and "password" are both zero instead of the actual values.
Code:
13 Replies
Yeah, so...
Dont post that connection string
Is there a reason youre not working with a local mysql instance? Like with XAMPP or something
What is your table defined as? The columns specifically
no I just found a free mysql host
wdym? I just gave them a name, user and password
You can run a database locally, FYI
And I second the question: what is the table defined as?
What does definied as mean? Its name is login
The columns
the names of the columns? sorry
Is name a varchar? a text? an int?
oh
Is the password a varchar, a byte, a datetime?
yea thats probably the issue, I didnt change that
If you get zeroes in both, then yes, they're probably some numeric type
And MySQL being MySQL just accepts the text and inserts zeroes, instead of throwing an error like any reasonable database would
what should the type be? Theres no normal string type. And what about the other properties like Null Index or Length/Values
it works!! thanks
Varchar, probably