MySQL Help
#1

In my .pwn i have code like this:


format(Query, sizeof(Query), "INSERT INTO `playerinfo` (`user`, `password`, `kills`, `deaths`, `score`, `money`, IP) VALUES ('%s', '%s', 0, 0, 0, 0, '%s')", escpname, escpass, PIP); //Insert string


but in .sql


Код:
CREATE TABLE IF NOT EXISTS `playeraccounts` (
  `playerName` varchar(24) NOT NULL,
  `playerPassword` varchar(129) NOT NULL,
  `playerAge` int(2) NOT NULL,
  `playerGender` int(1) NOT NULL,
  `playerOrigin` varchar(12) NOT NULL,
  `playerLevel` int(3) NOT NULL,
  `playerRespect` int(4) NOT NULL,
  `playerNRespect` int(4) NOT NULL,
  `playerSkin` int(3) NOT NULL,
  `playerGSkin` int(3) NOT NULL,
  `playerCash` int(8) NOT NULL,
  `playerBankCash` int(8) NOT NULL,
  `playerJob` int(2) NOT NULL,
  `playerHouse` int(3) NOT NULL,
  `playerRentHouse` int(3) NOT NULL,
  `playerBizz` int(3) NOT NULL,
  `playerCOBizz` int(3) NOT NULL,
  `playerCar` int(3) NOT NULL,
  `playerBike` int(3) NOT NULL,
  `playerBicycle` int(3) NOT NULL,
  `playerAdmin` int(4) NOT NULL,
  `playerLeader` int(2) NOT NULL,
  `playerMember` int(2) NOT NULL,
  `playerRank` int(1) NOT NULL,
  `playerGamedude` int(1) NOT NULL,
  `playerDonator` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
I need to change playerinfo to playeraccounts and other? Right?
Reply
#2

in the table you create
playerName

so when you INSERT INTO you will need this:
"INSERT INTO `playeraccounts` (`playerName`, `playerPassword`

and so on
Reply
#3

Dont get it, lol, u have msn ? I really need this help
Reply
#4

Your SQL query directives are not correct. Check this out.
Reply
#5

Can u help me on msn? Pm me ur msn
Reply
#6

CREATE TABLE IF NOT EXISTS `playerinfo` (
`user` varchar(24) NOT NULL,
`password` varchar(129) NOT NULL,
`kills` int(5) NOT NULL,
`death` int(5) NOT NULL,
`score` int(12) NOT NULL,
`money` int(3) NOT NULL,
`IP` char(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Reply
#7

This is common sense. You are executing a query which will fail immediately because you are telling it the table you are looking for is "playerinfo," yet that table doesn't even exist. You are also attempting to insert information to non-existent fields. Again, common sense.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)