IMPORTANT

FM Design is in read-only mode, please click here for more information.

Latest topics
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28

» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15

» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11

» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24

» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58

» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50

» Forumactif Edge - Releases
by Ange Tuteur Thu 14 Dec 2017, 11:25

» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22

» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12

» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10

» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51

» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11

» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19

» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34

» Numbering of messages in the topic
by SLGray Mon 04 Dec 2017, 22:40

Recent Tutorials
Top posting users this month
Who is online?
In total there are 9 users online :: 0 Registered, 0 Hidden and 9 Guests :: 1 Bot

None

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

Creating a database table

View previous topic View next topic Go down

avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 22
Posts : 4725
Points : 9670
Reputation : 2352
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 27 Jan 2015, 18:53

This topic will guide you through the steps of creating a database table.


Creating a database table

To create a new table go to your database control panel. ( the topic you created during installation ) If you're using the latest version you'll see an option in the navigation titled new table. Click this button and it will open a popup with a textarea.


In this textarea you'll be able to create your table; It is recommended you use bbcode tables. For it to show in the database list correctly, two vital attributes need to be included :

Class : The classname of your database table should be database_table. e.g. class="database_table"
ID : The ID of your new table should be a special one that refers to the purpose of the table. Take fa_likes as an example.

The basic layout should look something like this :
Code:
[table id="fa_test_table" class="database_table"]
[tr][td]Header 1[/td][/tr]
[/table]

As you can see in the example above, there's a default table row; this row will serve as the header label. These labels will help you identify what purpose the values of later rows serve.

When finished click submit and the new database table should be created.


Manual modifications of the newly added table can currently be made by clicking edit database from the navigation, and clicking the edit button on the post it belongs to.

--------

Ange Tuteur
Tips and TricksContact Me

avatar
brandon_g

Title :
Gender : Unspecified
Age : 20
Posts : 458
Points : 1785
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://broadcastingduo.forumotion.com

Postbrandon_g on Tue 27 Jan 2015, 20:38

What exactly is a database table?
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 22
Posts : 4725
Points : 9670
Reputation : 2352
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 27 Jan 2015, 20:49

@brandon_g wrote:What exactly is a database table?
A database is a for storing data. The tables I'm using help layout that data so it's easily read and retrieved when I need it. The table below holds the id of a post and the people who liked that post.

Inside the table we have rows and cells. In the above table I attach a special ID to one of the cells, so I can easily retrieve the data I need and display it in the post. Wink

You can actually view the database and its tables here : http://fmdesign.forumotion.com/t252-database

--------

Ange Tuteur
Tips and TricksContact Me

avatar
brandon_g

Title :
Gender : Unspecified
Age : 20
Posts : 458
Points : 1785
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://broadcastingduo.forumotion.com

Postbrandon_g on Tue 27 Jan 2015, 20:55

Interesting... so is it a topic? I knew what a database was, but not a database table or how you can make 1.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 22
Posts : 4725
Points : 9670
Reputation : 2352
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 27 Jan 2015, 21:05

Correct, it's a topic. Wink

There's no other way offered by Forumotion to store simple data such as the kind I've stored so far. I wanted to make it similar to a standard database table such as mySQL. It's just a bunch of bbcode tables, you can add as many columns, rows, etc as you want.. The only drawback would be the message character limit.

--------

Ange Tuteur
Tips and TricksContact Me

avatar
brandon_g

Title :
Gender : Unspecified
Age : 20
Posts : 458
Points : 1785
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://broadcastingduo.forumotion.com

Postbrandon_g on Tue 27 Jan 2015, 21:27

Ah ok, should it be a hidden topic, like in a staff lounge or admin lounge or something.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 22
Posts : 4725
Points : 9670
Reputation : 2352
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 27 Jan 2015, 21:54

@brandon_g wrote:Ah ok, should it be a hidden topic, like in a staff lounge or admin lounge or something.
If the database is for storing staff-specific data, then yes.

For public data, like the plugins I'm developing, you can find instructions here : http://fmdesign.forumotion.com/t281-a-database-for-your-forumotion-forum

Unfortunately the first plugin is currently phpbb3 specific, but I'll look into supporting all versions for it eventually. Smile

--------

Ange Tuteur
Tips and TricksContact Me

avatar
brandon_g

Title :
Gender : Unspecified
Age : 20
Posts : 458
Points : 1785
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://broadcastingduo.forumotion.com

Postbrandon_g on Tue 27 Jan 2015, 22:03

Ok, So why does it have to public to store public data, is this for the forums data, i mean is it like an automated thing the forum just takes from or does a humah moderator have to manually update it?
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 22
Posts : 4725
Points : 9670
Reputation : 2352
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 27 Jan 2015, 22:23

It has to be public, because all members will be able to moderate the forum which the topic is in. This allows them to freely edit any database table, except they're not really editing it, a script programmed to do so, is. Take the like button installed here for example,

When you click the like button, you're editing the database table which contains the likes and updating it with a new row or your name.

The forum itself will be hidden from all members except admins, but the topics within the forum can still be viewed. Having it completely open like I've done has some security risks like I've highlighted in the installation topic. As long as everything is taken into account and you're aware, you'll be fine. I've done it like so, so members can update and see the changes to the forum instantly.

--------

Ange Tuteur
Tips and TricksContact Me

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum