News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

September 19, 2019, 03:16:41 PM

Login with username, password and session length

Recent

Members
  • Total Members: 3752
  • Latest: Alizee
Stats
  • Total Posts: 188917
  • Total Topics: 20754
  • Online Today: 126
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 61
Total: 61

Author Topic: Can I call an SQL database in my PHP article block?  (Read 4377 times)

0 Members and 1 Guest are viewing this topic.

Offline dazebed

  • Newbie
  • *
  • Posts: 4
Can I call an SQL database in my PHP article block?
« on: April 11, 2015, 08:01:15 PM »
Bit confused about where to post this question,, apologizing in advance if it is in the wrong board. It might belong on the Themes board, although it's not specifically about either Block's themes or Jeff's or anyone else's. Mods please feel free to move it.

I am trying to decide between presenting some PHP/SQL tables that I already have linked to my forum, as an external article, or to edit them to work in a PHP article. The new 1.0 version of TP has many features I am not familliar with.

Link to my forum: http://www.yourdomain.com/forum/
SMF version: SMF ver. here 2.0.9
TP version: TP ver. here 1.0
Default Forum Language: Your Default Forum Language here English
Theme name and version: Theme name here Default,for now
Browser Name and Version: Browser name/version here Safari
Mods installed: Mods listed here None yet
Related Error messages: Error message here None yet

A bit more detail:  I had some web pages with some information on them, outside my SMF/TP forum,that were linked to my forum on the menu bar. I would like to use a TP article, if possible, to present that information on my forum, which I am currently rebuilding.I am using a test forum right now so unfortunately I cannot provide a link.

The external, linked pages included some tables of information which was called up from an SQL database I created outside my SMF database but in my domain.

I would like to use a TP article to display the table(S) instead of just linking to them on the menu bar. I am not sure if I should just post them as an "external page" through TP, or use a PHP page.

I had a number of files within the directory for these pages. 1) a style sheet for them  2) a menu which was called up with PHP on each of the pages (I wont need that since I can create a menu page in TP) and 2) the necessary files to create and access the database (dbcreatetable, dbaccess, dbconnect) 4) the files created for viewing,popuating and updating  the tables  5) the individual pages that the forum users saw when they wanted to look up something, and 6) some art for the pages (folders full of photos mostly)

Im pretty sure I can put the styles on the Article page as inline styles, and it is easy to link to pictures anywhere, but not sure where to put everything else. Would I just put them into the TP folder somewhere, and if so where? in the top level?

I guess at the heart of my question is... where would the tables work best?  Would putting them into a PHP article make them slower Would they be slower in an external page? Would they be better protected on a PHP page or as a exteral article? Would people without passwords be able to access them as external pages? (What security would there be for the external pages?)

Thanks in advance,
Laura

« Last Edit: April 12, 2015, 01:38:04 PM by dazebed »

Offline dazebed

  • Newbie
  • *
  • Posts: 4
Re: Can I call an SQL database in my PHP article block?
« Reply #1 on: April 13, 2015, 06:59:31 PM »
BTW I am searching for the docs to TP.I found some very old ones from 2006, and some incomplete ones that someone wrote when 1.0 was released but there are many empty pages in them. They are helpful to some degree but not enough for my needs unfortunately as posted above

Is there some chance that the docs will be completed soon? I'd like to see some explanation of some of the newer features of TP that I am unfamilliar with, without having to search the entire community site.

Thanks again in advance.
 :)

Offline bloc

  • Founder
  • *
  • Posts: 5217
    • Bloc
Re: Can I call an SQL database in my PHP article block?
« Reply #2 on: April 15, 2015, 09:38:54 AM »
I don't think any docs will help you with this, even if they are not written, as the way you have your work setup it will not fit within TP confines anyway. Essentially you have to write your own rendering page - perhaps in just an php article - but TP will not be able to just drag them out of a database. It expects articles to be already formatted and put into the tp-articles table.

"external" articles mean linking to a plain HTML or PHP article. SO if your articles were already on that format, it would just be a matter of linking each one into a empty TP article.

But back to the docs: ask away if you need clarification on how things work, thats probabaly faster than waiting for any updated in-depth docs on TP.

Offline dazebed

  • Newbie
  • *
  • Posts: 4
Re: Can I call an SQL database in my PHP article block?
« Reply #3 on: April 15, 2015, 05:18:19 PM »
Awwww.... rats! 

I suspected as much actually Bloc. Just kind of hoped to fit all of the little boxes more neatly inside each other. But I will keep things as they are now I guess.

BTW nice to speak to you, I really love TP and SMF.  They have worked great for me for 8 years. And I believe it is still important for us to have them available. We cannot let the net become a place where large businsses own all of our content.

Best regards to you and all the cool people at TP