FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

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

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49

» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21

» 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

» [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

Recent Tutorials
Top posting users this month

Who is online?
In total there are 18 users online :: 0 Registered, 0 Hidden and 18 Guests :: 2 Bots

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

Creating a database table

View previous topic View next topic Go down

Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12256
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur 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.

Creating a database table Screen16

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.

Creating a database table Screen17

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.
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4289
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Tue 27 Jan 2015, 20:38

What exactly is a database table?
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12256
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur 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.
Creating a database table Captur48

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 : https://fmdesign.forumotion.com/t252-database
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4289
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g 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.
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12256
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur 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.
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4289
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Tue 27 Jan 2015, 21:27

Ah ok, should it be a hidden topic, like in a staff lounge or admin lounge or something.
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12256
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur 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 : https://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
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4289
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g 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?
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12256
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur 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.
Sponsored content

PostSponsored content

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