dallassmith
06-23-2003, 03:20 PM
Anyone know how to add database users in mysql? I keep getting You have an error in your SQL syntax near ''username'), PASSWORD('password'))' at line 1 when I do INSERT INTO users (username, password) VALUES (‘someUser’, md5(‘somePass’));
What I usally do is set my Query in a variable, and then echo $query; Then I paste the query into MySQL and it usally gives me a better error message.
Lagniappe-labgeek
06-23-2003, 03:34 PM
Should it work with ` and ' (2 different marks - accent and single quote) that it appears you're using? I've never tried that...
looking again...
syntax near ''username'), PASSWORD
If there really a ")" after username' like it's suggesting?
dallassmith
06-23-2003, 03:45 PM
If there really a ")" after username' like it's suggesting?
No there isnt I dont know why it is saying that...
Lagniappe-labgeek
06-23-2003, 06:11 PM
Are you building the SQL command on the fly? If so, do as Troy suggests. It helps out with those pesky little syntax things sometimes (missing spaces is my big problem on generated sql).
dallassmith
06-23-2003, 06:17 PM
Like I even tried letting their little wizard type thing in phpmyadmin do it for me by adding info and for the username function i picked username and password function password then I typed in the values and got the same error! Labgeek you seem knowledgable anyway you could get on to AIM? Thanks!
-Aaron-
jundy
06-23-2003, 06:49 PM
Are you trying to this in a script or are you trying to create a user directly in mysql? If it is the latter then you should use the grant command.
dallassmith
06-23-2003, 07:11 PM
im tryin to create a user directory, not for a script that I downloaded but in a table so I can test out a php login tutorial which I am reading and try to see if I can get it to work.
Thanks,
Aaron
dallassmith
06-24-2003, 12:00 PM
Problem fixed! Thanks guys