MySQL Issues Again...
#1

Well I'm a newbie when it comes to MySQL and well I'm trying to transfer my Y_INI vehicles to MySQL but I got stuck here..

Errors
Код:
(1222) : error 035: argument type mismatch (argument 1)
(1223) : error 017: undefined symbol "mysql_store_result"
(1223) : error 017: undefined symbol "mysql_fetch_int"
(1223) : error 017: undefined symbol "mysql_free_result"
Code
PHP код:
#define TABLE_COS "vehs" // its not defined there in the function but on atop of the script just so you know
mysql_query("SELECT MAX(id) FROM `"TABLE_COS"`"); // - 1222
mysql_store_result(); vehnumb mysql_fetch_int(); mysql_free_result(); // - 1223 
Reply
#2

maybe run an older version of "mysql" or newer
can go and so

PHP код:
format(strtsizeof(strt), "SELECT * FROM `TABLE_COS` WHERE `id` > 0");
mysql_tquery(SQLstrt"LoadInfo""");
public 
LoadInfo()
{
    
IDD cache_num_rows();
    for(new 
1<= IDDi++)
    {    
        
// Next your script
    
}

Reply
#3

Quote:
Originally Posted by rollercaster
Посмотреть сообщение
you can run an older version of "mysql"
can go and so

PHP код:
format(strtsizeof(strt), "SELECT * FROM `TABLE_COS` WHERE `id` > 0");
mysql_tquery(SQLstrt"LoadInfo""");
public 
LoadInfo()
{
    
IDD cache_num_rows();
    for(new 
1<= IDDi++)
    {    
        
// Next your script
    
}

Well I would like to continue to use this one, is there a solution for this?
Reply
#4

what do you want to do exactly?
Reply
#5

Quote:
Originally Posted by rollercaster
Посмотреть сообщение
what do you want to do exactly?
I want to count all the vehicles that get created, or loaded whatever
Reply
#6

PHP код:

format
(strtsizeof(strt), "SELECT * FROM `TABLE_COS` WHERE `id` > 0"); 
mysql_tquery(SQLstrt"LoadInfo"""); 
public 
LoadInfo() 

    new 
cars 0;
    
IDD cache_num_rows(); 
    for(new 
1<= IDDi++) 
    {     
        
cars++;
        
// Next your script 
    
}
    
printf("Vehicles Created: %d"cars);

something like.
Reply
#7

Fixed
Reply
#8

Quote:
Originally Posted by Florin48
Посмотреть сообщение
PHP код:

format
(strtsizeof(strt), "SELECT * FROM `TABLE_COS` WHERE `id` > 0"); 
mysql_tquery(SQLstrt"LoadInfo"""); 
public 
LoadInfo() 

    new 
cars 0;
    
IDD cache_num_rows(); 
    for(new 
1<= IDDi++) 
    {     
        
cars++;
        
// Next your script 
    
}
    
printf("Vehicles Created: %d"cars);

something like.
IDD would be enough, the purpose of the loop is completely pointless. Even then, there is a better way.
pawn Код:
SELECT COUNT(*) FROM table_name
returns 1 row and is retrieved as:
pawn Код:
cache_get_value_int(0, 0, total_vehicles);
Reply
#9

you can just Select * and use number of rows affected to count total rows.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)