Jockie Posted October 10, 2010 Share Posted October 10, 2010 I'm currently stuck with a tiny problem, I want to save every race map name into the database with accountname+stats. But the thing is, it does nothing. No errors in the debugscript, no overheaded data at database. fullname = "test" -- fullname is the name of the map(from a map table) --MySQL > Connection to the database, that works. ;D mysql_query( MySQL, "CREATE TABLE '<databasename>."..fullname.."' ( id INT( 11 ) NOT NULL , name VARCHAR( 255 ) NOT NULL , latest VARCHAR( 255 ) NOT NULL , played VARCHAR( 255 ) NOT NULL , won VARCHAR( 255 ) NOT NULL , latest1 VARCHAR( 255 ) NOT NULL , played1 VARCHAR( 255 ) NOT NULL , won1 VARCHAR( 255 ) NOT NULL , latest2 VARCHAR( 255 ) NOT NULL , played2 VARCHAR( 255 ) NOT NULL , won2 VARCHAR( 255 ) NOT NULL )") mysql_query( MySQL, "ALTER TABLE "..fullname.." ADD PRIMARY KEY ( id )") mysql_query( MySQL, "ALTER TABLE "..fullname.." CHANGE id id INT( 11 ) NOT NULL AUTO_INCREMENT ") Link to comment
dzek (varez) Posted October 10, 2010 Share Posted October 10, 2010 check what first mysql_query is returning. I don't remember how to get error of query in mta but the query is invalid. also you should create table once, so CREATE TABLE IF NOT EXISTS will be better. I suggest you to get back to mysql manual. your table logic isn't good one to. columns like "won" should be int i think. summary: read manual, re-think that again and rewrite from scratch Link to comment
Jockie Posted October 11, 2010 Author Share Posted October 11, 2010 I found the problems, those are the "[", "]", "" and "-" in the name. Like [DM] Pr0nOoB - Summer Beach So how to make is saveable and that the "[", "]", "" and "-" will save? Link to comment
dzek (varez) Posted October 11, 2010 Share Posted October 11, 2010 i dont understand. first thing that is incorrect is this: "." - you can simply remove it 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