Posts: 785
Threads: 22
Joined: Jun 2007
Reputation:
0
ALTER TABLE 'table_name' DROP 'column_name'
Posts: 3,793
Threads: 196
Joined: Jan 2010
Reputation:
0
Damn, IDK where to use that but i just want to make something that will search for a certain GANGID and delete the place where the gang id is but the current code i have wont work basicly, if you're right do you mind posting an example to what i should do to do this
Posts: 1,113
Threads: 110
Joined: Nov 2009
Reputation:
0
Do you understand the difference between a column and a row?
Posts: 3,793
Threads: 196
Joined: Jan 2010
Reputation:
0
Well, in mysql no, in SQL not really, i just started using sql a couple of days ago
and what i ment by COLUMN is the complete line of the gang
`GANGNAME`, `GANGID`, `GANGLEADER`
for example
Posts: 785
Threads: 22
Joined: Jun 2007
Reputation:
0
columns = |
rows = __
If you use the query you posted in your first post, that will delete the row which has %d as gang ID.
Or tell us what exactly you want to do, then it might be easier to explain ..
Posts: 785
Threads: 22
Joined: Jun 2007
Reputation:
0
Supposing GANGID is an integer, try this instead;
DELETE FROM `GANGS` WHERE `GANGID` = %d
The query is definitely OK and should delete the row.
You also don't need to use free_result when deleting a row.
Posts: 1,113
Threads: 110
Joined: Nov 2009
Reputation:
0
Test it and see! Although you may want to loop through all connected players, see if their gang == gangid, and if so set their gang to 0.