MySQL fetching row problem! [URGENT HELP]
#6

I don't understand what exactly your system is trying to do. It will get the "hwid" of all resulting players, but only uses the last one of them? If I understand you correctly and it looks like you only use ONE field, not any others, you can optimize and simplify your querying process a lot.

pawn Код:
format(hquery, sizeof(hquery), "SELECT hwid FROM hwuser WHERE name = '%s'", PNAME);
mysql_query(hquery);
mysql_store_result();
// If you're not 100% sure about results, also include a mysql_num_rows check
new hw_id[15]; // change to a higher value if the ids are longer in some case
mysql_fetch_row(hw_id);
mysql_free_result();

// now REUSE the previous hquery string, no need for a new one!
format(hquery, sizeof(hquery), "INSERT INTO hwbans(name, hwid, IP) VALUES('%s', '%s', '%s')", PNAME, hw_id, PlayerIP);
mysql_query(hquery);
Kick(playerid);
There's no need to use the player's hwid array. But I just didn't because I don't know if you have that created as a proper array. I hope this helps you at least a little.
Reply


Messages In This Thread
MySQL fetching row problem! [URGENT HELP] - by fiki574 - 15.04.2012, 20:44
Re: MySQL fetching row problem! [URGENT HELP] - by fiki574 - 16.04.2012, 08:33
Re: MySQL fetching row problem! [URGENT HELP] - by Roel - 16.04.2012, 09:47
Re: MySQL fetching row problem! [URGENT HELP] - by fordawinzz - 16.04.2012, 09:51
Re: MySQL fetching row problem! [URGENT HELP] - by fiki574 - 16.04.2012, 18:36
Re: MySQL fetching row problem! [URGENT HELP] - by AndreT - 16.04.2012, 18:45
Re: MySQL fetching row problem! [URGENT HELP] - by fiki574 - 16.04.2012, 18:51

Forum Jump:


Users browsing this thread: 2 Guest(s)