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
#2

Why do you need the empty id? To create a new vehicle?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)