damien111 Posted July 5, 2014 Share Posted July 5, 2014 I cant figure out whats wrong with my "mysql" syntax..Can someone help me out? Heres the validator : http://www.w3.org/2005/01/yacker/uploads/MySQL/?lang=c&text=%22INSERT+INTO+housingdata%28name%2C+address%2C+type%2C+interior%2C+intlock%2C+owner%2C+price%2C+value%2C+income%2C+status%2C+x%2C+y%2C+z%2C+csX%2C+csY%2C+csZ%2C+csrX%2C+csrY%2C+csrZ%29+VALUES%28%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%29%22&action=validate+text It has the code in link and it will tell you whats wrong with it. But i dont know what its asking for i dont know mysql querys very well Link to comment
MTA Team botder Posted July 5, 2014 MTA Team Share Posted July 5, 2014 The original MySQL syntax doesn't accept those "?" placeholders. The error tells you that there is no valid insert-values in that query. Link to comment
damien111 Posted July 5, 2014 Author Share Posted July 5, 2014 So like this? local queryResult = mysql_query(mysqlHandler,"INSERT INTO housingdata(name, address, type, interior, intlock, owner, price, value, income, status, x, y, z, csX, csY, csZ, csrX, csrY, csrZ) VALUES("..name..","..address..","..typeint..",0,'0','LGC Housing Team',"..tonumber(price)..","..tonumber(price)..","..tonumber(income)..","..tonumber(status)..","..tonumber(x)..","..tonumber(y)..","..tonumber(z)..",".. tonumber(csx)..",".. tonumber(csy)..","..tonumber(csz)..","..tonumber(csrx)..","..tonumber(csry)..","..tonumber(csrz)..")") EDIT: That didnt work either, its taking the values as collumn names? Link to comment
MTA Team botder Posted July 5, 2014 MTA Team Share Posted July 5, 2014 Where does mysql_query come from? Why are you not using dbConnect and dbQuery? Link to comment
damien111 Posted July 5, 2014 Author Share Posted July 5, 2014 The module. https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL Link to comment
MTA Team botder Posted July 5, 2014 MTA Team Share Posted July 5, 2014 mysql_query(mysqlHandler,"INSERT INTO housingdata(`name`, `address`, `type`, `interior`, `intlock`, `owner`, `price`, `value`, `income`, `status`, `x`, `y`, `z`, `csX`, `csY`, `csZ`, `csrX`, `csrY`, `csrZ`) .... ) I suspect that one of your column names is a MySQL keyword and makes the query fail. Try that. Link to comment
damien111 Posted July 5, 2014 Author Share Posted July 5, 2014 Like this? Cause this didnt work either , got the error : "Unkown Collumn test in field table", and test is the value i put in for 'name' local queryResult = mysql_query(mysqlHandler,"INSERT INTO housingdata(`name`, `address`, `type`, `interior`, `intlock`, `owner`, `price`, `value`, `income`, `status`, `x`, `y`, `z`, `csX`, `csY`, `csZ`, `csrX`, `csrY`, `csrZ`) VALUES("..name..","..address..","..typeint..",0,'0','LGC Housing Team',"..tonumber(price)..","..tonumber(price)..","..tonumber(income)..","..tonumber(status)..","..tonumber(x)..","..tonumber(y)..","..tonumber(z)..",".. tonumber(csx)..",".. tonumber(csy)..","..tonumber(csz)..","..tonumber(csrx)..","..tonumber(csry)..","..tonumber(csrz)..")") Link to comment
damien111 Posted July 5, 2014 Author Share Posted July 5, 2014 Now im getting another error, local queryResult = mysql_query(mysqlHandler,"INSERT INTO housingdata(id ,name, address, type, interior, owner, price, value, income, status, x, y, z, csX, csY, csZ, csrX, csrY, csrZ) VALUES("..id..","..name.."','"..address..","..typeint..","..interior..",'LGC Housing Team',"..tonumber(price)..","..tonumber(price)..","..tonumber(income)..","..tonumber(status)..","..tonumber(x)..","..tonumber(y)..","..tonumber(z)..",".. tonumber(csx)..",".. tonumber(csy)..","..tonumber(csz)..","..tonumber(csrx)..","..tonumber(csry)..","..tonumber(csrz)..")") Doesnt use the first value i give it, instead it ignores itand gives me error. Link to comment
Cadell Posted July 5, 2014 Share Posted July 5, 2014 Btw its not mysql script and stop using leaked script this is leaked script of wss rpg Link to comment
Mr_Moose Posted July 5, 2014 Share Posted July 5, 2014 mysql_query() is a php function and won't work in lua, see this: https://wiki.multitheftauto.com/wiki/DbConnect Link to comment
MTA Team botder Posted July 5, 2014 MTA Team Share Posted July 5, 2014 mysql_query() is a php function and won't work in lua, see this: https://wiki.multitheftauto.com/wiki/DbConnect Except when he is using a module, which provides that function, he already mentioned above you. Link to comment
Mr_Moose Posted July 5, 2014 Share Posted July 5, 2014 The problem remains, module or not, the syntax of that function isn't the same as in dbConnect, currently MySql support are built in so there is no point of using that kind of modules. BTW it's not completely unlike that the module is written in php after all. I would still recommend dbConnect for this. Link to comment
albers14 Posted July 11, 2014 Share Posted July 11, 2014 Btw its not mysql script and stop using leaked script this is leaked script of wss rpg THAT GUY SHOULD GET A MEDAL! HE IS TOTALLY RIGHT Good luck with your little rpg damien... Link to comment
mjau Posted July 11, 2014 Share Posted July 11, 2014 Haha, when you cant even get leaked scripts to work damien i doubt there is any chance for your RPG. Good luck tho. And guess someone can lock this topic as this is a stolen resource from WSS:RPG. I can provide proof if needed. Link to comment
Recommended Posts