[MySQL] Problem with extraction data - 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] Problem with extraction data (
/showthread.php?tid=130115)
[MySQL] Problem with extraction data -
ErF - 25.02.2010
Hey, any time there. I'm having trouble downloading data from MySQL. I want to let you type commands from levying all things to the table if they are assigned to the player ID. Query looks like this: "SELECT * FROM test WHERE uid = (player uid here)". My table structure looks something like this:
+----+-----+-------+
| id | uid | name |
+----+-----+-------+
| 6 | 1 | Item1 |
| 7 | 1 | Item2 |
| 8 | 1 | Item3 |
| 9 | 1 | Item4 |
| 10 | 1 | Item5 |
+----+-----+-------+
The game should look like this:
[ID: 6] Item1
[ID: 7] Item2
[ID: 8] Item3
[ID: 9] Item4
[ID: 10] Item5
But it looks so:
Does not display the name
Code:
Код:
if(mysql_num_rows() > 0)
{
SendClientMessage(playerid,White,"All:");
while(mysql_fetch_row(result))
{
explode(row,result,"|");
format(string,sizeof(string),"[ID: %d] %s",strval(row[0]),strval(row[2]));
SendClientMessage(playerid,WHITE,string);
}
}
else
{
SendClientMessage(playerid,WHITE,"Empty!");
}
Re: [MySQL] Problem with extraction data -
Rac3r - 25.02.2010
strval(row[2])
Just try row[2]
Re: [MySQL] Problem with extraction data -
ErF - 25.02.2010
yee working xD, thanks