Mysql wont create a table
#1

When ever I join my server it asks me to register because it isnt saving my player info to the database when I disconnect. It was saving before, But I decided to drop my user out of the database and since then it isnt creating my player info again Why is that?

Код:
		case 1:
		{
			if(response)
			{
				new query[126], pName[MAX_PLAYER_NAME];
				GetPlayerName(playerid, pName, sizeof(pName));
			
				format(query, sizeof(query), "INSERT INTO accounts (Name, Password, PlayerPos) VALUES ('%s', '%s', '1.0 2.0 3.0)", pName, inputtext);
				mysql_query(query);
				
				SendClientMessage(playerid, -1, "You have registered!");
				
				SetSpawnInfo(playerid, 0, 299, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
				SpawnPlayer(playerid);
				SetCameraBehindPlayer(playerid);
			}	
		}	
	}	
	return 1;
}
mysqldebug says "An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1.0 2.0 3.0)' at line 1)"
Reply
#2

Missing ' after '1.0 2.0 3.0?
Reply
#3

That code doesn't create table, it inserts info on it
This code creates table :
Код:
mysql_query("CREATE TABLE IF NOT EXISTS accounts(Name VARCHAR(24), password VARCHAR(41), PlayerPos INT(20) )");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)