Problem loading MySQL.
#1

Hi, I have problem, no loading items in game, problem create loop while, code:


Quote:


new str[250],uid;
mysql_query("SELECT * FROM `items`");
mysql_store_result();

while(mysql_fetch_row(str, "|"))
{
sscanf(str, "p<|>d", uid);
sscanf(str, "p<|>is[32]iiiiiiffffff",
Items[uid][pUID],
...

I use include <mysql>

Please help me.
Reply
#2

pawn Код:
while(mysql_fetch_row(str, "|"))
{
sscanf(str, "p<|>dis[32]iiiiiiffffff",
uid,
Items[uid][pUID],
Reply
#3

unfortunately doesn't work.
Reply
#4

Show your 'Items' enum and MySQL table structure.
Reply
#5

enum:
Quote:

enum pItems {

pUID,
pType,
pName[32],
pUsing,
pModel,
pAmount,
pWeight,
pTrash,
pValue,
FloatPosX,
FloatPosY,
FloatPosZ,
FloatPotX,
FloatRotY,
FloatRotZ,
pVW,
Text3D:TextLabel,
pModelid

};

stock Items[MAX_ITEMS][pItems];
};

Structure:

Quote:

CREATE TABLE `items` (
`UID` int(11) NOT NULL auto_increment,
`Name` varchar(32) NOT NULL,
`Using` int(11) NOT NULL,
`Model` int(11) NOT NULL,
`Amount` int(11) NOT NULL,
`Weight` int(4) NOT NULL,
`Trash` int(1) NOT NULL,
`Value` int(11) NOT NULL,
`PosX` float NOT NULL,
`PosY` float NOT NULL,
`PosZ` float NOT NULL,
`RotX` float NOT NULL,
`RotY` float NOT NULL,
`RotZ` float NOT NULL,
`VW` int(11) NOT NULL,
PRIMARY KEY (`UID`)
) ENGINE=MyISAM DEFAULT CHAR

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)