help with mysql check
#1

pawn Код:
Total_Veh_Created++;
        new CHECKquery[128];
        format(CHECKquery,128,"SELECT Model FROM `veh` WHERE vID = %i",Total_Veh_Created);
        mysql_query(CHECKquery);
        mysql_store_result();
        if(mysql_num_rows() >= 1)
        {
                      // id exists
            mysql_free_result();
            return 1;
        }
        mysql_free_result();
When i use this code i need to pickuppickup several times to get empty id, what can i use instead of single Total_Veh_Created++; to get the empty id direkt. vID field has unique key
Reply


Messages In This Thread
help with mysql check - by ajwar - 01.10.2011, 15:19
Re: help with mysql check - by MadeMan - 01.10.2011, 15:57

Forum Jump:


Users browsing this thread: 1 Guest(s)