Problem MySQL
#1

Hello, I have a problem with the subject of checking data, that is, I do not get it right as I take the data from the tables, here I leave my script

PHP код:
format(Querysizeof(Query), "SELECT * FROM players WHERE nombre='%s'"NOMBRE);
mysql_query(Query); // No query line
mysql_free_result();
if(
mysql_num_rows())
{
     new
        
apc[50],
        
string[215],
        
savingstring[256],
        
anickc[30],
        
plakc[45]; 

Let's say that it takes data from the players table, but I do not know how to select what I want, here I have two questions to use

PHP код:
mysql_fetch_field_row(apc"apple");
mysql_fetch_field_row(anickc"nickplaq");
mysql_fetch_field_row(plakc"plakic"); 
or this

PHP код:
mysql_fetch_field_row(savingstring"apple"); apc strval(savingstring);
mysql_fetch_field_row(savingstring"nickplaq"); anickc strval(savingstring);
mysql_fetch_field_row(savingstring"plakic"); plakc strval(savingstring); 
here you can see so that you took the data from the tables

PHP код:
format(stringsizeof string"PLAYER: %s"NOMBRE);
SendClientMessage(playerid, -1string);
format(stringsizeof string"APPLE: %s - ANICKC: %s - PLAKC: %s"apcanickcplakc);
SendClientMessage(playerid, -1string); 
They could tell me that MYSQL's function is convenient for me to use or the error I make, it is to extract the data, as to inform me not to give value to something of the player.
Reply
#2

and when I use the mysql_fetch_field example function:

PHP код:
New apc[50]
mysql_fetch_field("apple"Data); 
I miss the error:

error 035: argument type mismatch (argument 1)
Reply
#3

Help. I forgot to say that I use mysql r5
Reply
#4

try
Код:
mysql_fetch_field("apple", Data, 35);
Please change string length(35 in example) to match your needs
Reply
#5

Quote:
Originally Posted by kovac
Посмотреть сообщение
try
Код:
mysql_fetch_field("apple", Data, 35);
Please change string length(35 in example) to match your needs
I do not see any. But in the case that I would like to find a single piece of information, I would like to:

PHP код:
format(Querysizeof(Query), "SELECT apple FROM players WHERE Nick='%s'"Nombre);
        
//mysql_query(Query,UPDATES,playerid);
        
mysql_query(Query); // No query line
        
mysql_store_result();
        new
           
rows mysql_num_rows();
        if(
rows >= 0)
        {
            new
               
data[16],
               
string[226];
            
mysql_fetch_row(data);
            
format(stringsizeof string"Nick: {00CCFF}%s{FFFFFF} | APPLE: {ffff00}%s"Nombredata);
            
SendClientMessage(playerid, -1string);
            return 
1;
        } 
I can not figure out how to take various data and then dump them. You can only one at a time.
Reply
#6

what version of mysql you use?
Reply
#7

Quote:
Originally Posted by Florin48
Посмотреть сообщение
what version of mysql you use?
he uses MySQL R5

OT: you're getting wrong data or you're getting nothing?
Reply
#8

MySQL r5 is a very old version. Use the latest R41 or R39.
Reply
#9

Quote:
Originally Posted by Mugala
Посмотреть сообщение
he uses MySQL R5

OT: you're getting wrong data or you're getting nothing?
I do not get anything
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)