PDA

View Full Version : How to add tables/fiels to DB


odsnet
11-25-2010, 08:47 AM
Hello,

I'd like to write a plugin which stores something (related to a thread) in the database. So I'd like to extend the thread table for one field. If that isn't possible I could add another table where the extra data is stored. but then I've got to make sure that this table cascades on delete and so on.
How could I alter the Thread table with the VB API in a plugin?

I found how to add a field to the form here: https://vborg.vbsupport.ru/showthread.php?t=237982 but it shouldn't be appended to the posting but stored in an extra field.

Best regards,
Heiko

Lynne
11-25-2010, 02:03 PM
I'm not sure what you are asking for - how to add a field, or the code to put into a plugin to add a field. Just add a field via phpMyAdmin and it will spit out the query it used and then you can put that into your installation code for your product. You should be able to download some other mod here that does this and take a look at how they did it.

odsnet
11-26-2010, 06:40 AM
Thanks for you reply.
I'd like to know how to add a field via the API. Or isn't there any API for this?