SA-MP Forums Archive
MySQL Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL Help (/showthread.php?tid=261082)



MySQL Help - undeR. - 12.06.2011

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?


Re: MySQL Help - swieberdevos - 12.06.2011

in the table you create
playerName

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

and so on


Re: MySQL Help - undeR. - 12.06.2011

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


Re: MySQL Help - Cyanide - 12.06.2011

Your SQL query directives are not correct. Check this out.


Re: MySQL Help - undeR. - 12.06.2011

Can u help me on msn? Pm me ur msn


Re: MySQL Help - Forever Alone - 12.06.2011

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;


Re: MySQL Help - Scenario - 12.06.2011

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.