asprin
Active member
My addon will be using the credits/vcash feature from other some other addons (to my knowledge, there about 2-3 addons that add this feature). The basic idea is to know which column in the
![1581078660787.webp 1581078660787.webp](https://xenforo.com/community/data/attachments/217/217859-4da7fc32290877d74a9a58dbe0a52e0d.jpg?hash=Taf8MikId9)
Now whenever I want to modify the value in this column, I feel it's best to validate the existence of the column first (because the site admin may not always be accurate with the words/spelling of the column) before running the update query on the table/entity.
So is there a valid way to check this from my addon's controller? Can I directly use the
xf_user
table does the addon store the vcash/credit value. In order to do this, I've added two fields as part of my addon options like below:![1581078660787.webp 1581078660787.webp](https://xenforo.com/community/data/attachments/217/217859-4da7fc32290877d74a9a58dbe0a52e0d.jpg?hash=Taf8MikId9)
Now whenever I want to modify the value in this column, I feel it's best to validate the existence of the column first (because the site admin may not always be accurate with the words/spelling of the column) before running the update query on the table/entity.
So is there a valid way to check this from my addon's controller? Can I directly use the
$db
object to do a SHOW COLUMNS
query or is there a more effective to do that?