Forum Moderators: coopster
i need to be able to add or remove db table column.
First solution to come in mind is to use ALTER TABLE query.
But somehow it doesnt seem to be the right choise :-)
The task is simple realy. There is a data table and the user must can to add additional column or remove one. And i, somehow must track what he did, couse ill be running select/update and other queries on that table, so i must know which columns exists etc..
Maybe someone has done something similar and could share his thoughts :-)
this doesn't seem like the best way to go about things.
though if this is what you feel you need to do you need to use ALTER TABLE to do the actual table changes
a good way to find needed functions is to search the main page for those set of functions
[php.net...]
there is a little function here that might help
[webmasterworld.com...]
if “y” then you act as if the col you are looking for is there
if “n” then act as if the col “does not exist”
just add in your query WHERE y_n=’$y_n’
<edit>
On the top of that
it is always a good practice to limit as much as possible user's DB privileges.
they should not be allowed to deal with your DB cols
</edit>