Latest topics
» IconSkouliki Graphics
by skouliki Fri 20 Oct 2017, 05:08

» "Edit this page" feature
by skouliki Fri 20 Oct 2017, 01:37

» Dark Mode + Another Question
by Haggis Thu 19 Oct 2017, 10:36

» [GAME] Count to 1000 using even numbers Van-Helsing Edition
by Van-Helsing Tue 17 Oct 2017, 15:07

» [GAME] What are you thinking right now?
by Ace 1 Tue 17 Oct 2017, 08:09

» [GAME] Count to One Million!
by Ace 1 Tue 17 Oct 2017, 08:07

» [GAME] Last Letter Game
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] World Snake
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] Never have I ever..
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] Animal Game
by universecat Mon 16 Oct 2017, 21:43

» [GAME] Post a random picture
by SLGray Mon 16 Oct 2017, 16:28

» Hi everyone!
by skouliki Mon 16 Oct 2017, 02:01

» Hai Guys~
by skouliki Mon 16 Oct 2017, 01:59

» Add a login popup for the toolbar
by Ape Sun 15 Oct 2017, 13:51

» Mobile Usability Test
by Ange Tuteur Sat 14 Oct 2017, 11:20

Recent Tutorials
Who is online?
In total there are 6 users online :: 0 Registered, 0 Hidden and 6 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 : 21
Posts : 4698
Points : 9540
Reputation : 2337
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.
avatar
brandon_g

Title :
Gender : Unspecified
Age : 20
Posts : 447
Points : 1664
Reputation : 63
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 : 21
Posts : 4698
Points : 9540
Reputation : 2337
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
avatar
brandon_g

Title :
Gender : Unspecified
Age : 20
Posts : 447
Points : 1664
Reputation : 63
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 : 21
Posts : 4698
Points : 9540
Reputation : 2337
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.
avatar
brandon_g

Title :
Gender : Unspecified
Age : 20
Posts : 447
Points : 1664
Reputation : 63
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 : 21
Posts : 4698
Points : 9540
Reputation : 2337
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
avatar
brandon_g

Title :
Gender : Unspecified
Age : 20
Posts : 447
Points : 1664
Reputation : 63
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 : 21
Posts : 4698
Points : 9540
Reputation : 2337
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.

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