Saving to DB from Player enum. Possible cause of fault?
#2

It seems to me that the problem is you aren't updating pAccountID with the ID that they're assigned in the database. AccountID needs to be the primary key in your table, and after your insert statement you should set Player[playerid][pAccountID] to mysql_insert_row(), or whatever the equivalent function is in the plugin you're using. (Ideally you should be threading these queries but that can wait for later.)

The first query isn't correct though, it should be WHERE AccountID = %d, not WHERE playerid = %d. The second set of queries, where you update in pieces, looks correct but unless I'm missing something, each one of those queries is trying to update WHERE AccountID = 0, which isn't going to do anything.

You should echo those queries to the console just to be sure. Having phpmyadmin is nice because you can just feed them into it and it'll cough out any error messages that the queries generate.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)