1
Cozzie
Smart section: can I add extra columns to its database?
  • 2007/9/12 3:07

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Hi,

My question is: can I add extra colums to the smartsection_items table/database (this is the table that stores the articles)?

Or any other module's db table for that matter??

I want each article to display some additional parameters beside the text of the article, and I just wanted to check that it is ok to do this?

Also I'll be adding about 10 new columns, will that make the table too large (it already has 25 columns)???

How many columns can a table have before it affects performance?

Thanks a lot for any replies!!!

2
Cozzie
Adding new fields to a module's existing tables?
  • 2007/9/17 7:30

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


I've added the columns to the "items" table and inputted data and all seems to be working well.

Now I have one more problem, hope somebody can give me some advice.

Right now I have to use phpmyadmin to add data to any of the new columns that I have added.

So if a user presses the Submit Article button they can't add values to the new fields. How can I adjust the submit.php file to allow users to successfully add values to the new fields as well as the original one (article title, introduction, main text etc.).

If anyone has done anything similar for other modules couldyou let me know?

Thanks!!!

3
Cozzie
Re: Adding new fields to a module's existing tables?
  • 2007/9/25 6:51

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Hello

I'm still stuck on this and I've got to find the answer by the end of the week so if anybody has any ideas I' really appreciate the help

Basically I am using the module smartsection. As with all article modules it allows me to compose articles with a title, an introduction, main text, an image etc.

Its great, but I have added a few additional columns to the article's database table and adjusted the pages so that these new values are also shown on each article.

The problem is that I can't figure out how to change the submit and admin pages so that when editing articles users can input/change these new values as well as the original ones.

All I can do is input the data in the new columns via phpmyadmin but this is not making my boss happy!

Can anyone help???


4
Shine
Re: Adding new fields to a module's existing tables?
  • 2007/9/25 9:32

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Yo9u have to adjust all files of this module. A connection has to be made from out of the module to the DB. Very complicated.
What kind of columns have you ad? I think the module as so many columns etc. that I can not think of what should be added extra.

5
Cozzie
Re: Adding new fields to a module's existing tables?
  • 2007/9/25 10:29

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Hi Shine and thanks!

Each article is actually about university courses and so I added columns so that we could also display course details (such as tuition fee, entry requirements, email contact etc.) for each course. You can see it at:

http://how2uk.com/modules/coursesearch/item.php?itemid=11

So I know its a little unusual but we've kind of used an article module to suit our needs.

So each column just contains basic values for each course (price=10,000 start date=Sept) etc

Can the update of the submit/edit pages be done do you reckon?

Login

Who's Online

347 user(s) are online (249 user(s) are browsing Support Forums)


Members: 0


Guests: 347


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits