03.08.2010, 17:16
Quote:
I'd rather add an SQL ID in the database as well. This should be the first value in the table and should be set as Primary Key and Auto-increment.
You can then retrieve this value when someone registers (mysql_insert_id) and assign it to a variable. You can then use this value to execute future queries on the database without retrieving the player's name every time. And you can use sscanf instead of explode to split rows into the data you need, as TheKiller already suggested. |
it doesn't slows it down or something, it works fine, and it's more handy.
And explode is way faster then sscanf for doing MySQL stuff like this.
I don't know why, but since i started this topic people are only whining about the 'problems' there are in this script a.k.a. not scripted on the way they should do.
There are no problems with this script, this is the fastest way to do it, the script has a clean optimized code, and i do explain a lot.
And this is the only MySQL tutorial that actually shows (with screens) how to set up a database!