silverorder Posted June 11, 2012 Share Posted June 11, 2012 Hello. trying to make a mysql login system. the error: script.lua:37: bad argument #1 to 'mysql_query' line 37 looks like this local query = mysql_query("SELECT * FROM `users` WHERE `username` = '" .. username .. "' AND `password` = '" .. pass .. "'") The error only appears when i try to login All the tags i use is the same as in my db.. checked over 100 times I have no idea work this one out i have search up and down the forums and found nothing. I started scripting my own MTA yesterday, but have past exp. a little lua, PHP and mysql plus some more. Link to comment
Guest Guest4401 Posted June 11, 2012 Share Posted June 11, 2012 line 37 looks like this local query = mysql_query("SELECT * FROM `users` WHERE `username` = '" .. username .. "' AND `password` = '" .. pass .. "'") First argument of mysql_query isn't the query itself. First argument is supposed to be handler, and the second one the query. See syntax: https://wiki.multitheftauto.com/wiki/Mod ... ysql_query Link to comment
silverorder Posted June 11, 2012 Author Share Posted June 11, 2012 Fixed it! The link help me a ton. Mixed up some code while trying fix it and just keeping making it worse.. but i solved it! Thanks for the help and link! Bookmarked it for future use Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now