Mysql Questions - 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 Questions (
/showthread.php?tid=206526)
Mysql Questions -
Anthonyx3' - 04.01.2011
Hey guys, these questions might make some of you laugh, but w.e idc, i could use some help understanding mysql more.
Alright say im going to use enums for the system, for example:
pawn Код:
enum pInfo
{
pUsername,
pSQLid,
pPassword
}
new PlayerInfo[MAX_PLAYERS][pInfo];
How would i correctly make a database for this? I know i use VARCHAR for username and password, and i set them at 24 value. But how do i know what to set the pSQLid to, the house keys, the items, etc to.
If someone could explain this, and use my example of psqlid, i would be forever grateful, lol, yeah i sound corny oh well.
some other enums you could use to explain, could be pFaction, then maybe floats, for locations. Thanks in advance.
Re: Mysql Questions -
Leeroy. - 04.01.2011
Quote:
Originally Posted by Anthonyx3'
Hey guys, these questions might make some of you laugh, but w.e idc, i could use some help understanding mysql more.
Alright say im going to use enums for the system, for example:
pawn Код:
enum pInfo { pUsername, pSQLid, pPassword } new PlayerInfo[MAX_PLAYERS][pInfo];
How would i correctly make a database for this? I know i use VARCHAR for username and password, and i set them at 24 value. But how do i know what to set the pSQLid to, the house keys, the items, etc to.
If someone could explain this, and use my example of psqlid, i would be forever grateful, lol, yeah i sound corny oh well.
some other enums you could use to explain, could be pFaction, then maybe floats, for locations. Thanks in advance.
|
pawn Код:
enum pInfo
{
pUsername[24],
pSQLid,
pPassword[128],
Float:pPos[4],
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Will work. PSQLid has to be null auto-increment and Number. Use FLOAT for pPos.
Click.
Re: Mysql Questions -
Anthonyx3' - 04.01.2011
Yeah, but im trying to add to databasse i just know how to correctly insert, like idk if i pick int, varchar, etc.
Re: Mysql Questions -
Leeroy. - 04.01.2011
Quote:
Originally Posted by Anthonyx3'
Yeah, but im trying to add to databasse i just know how to correctly insert, like idk if i pick int, varchar, etc.
|
Check this.