Pulling data from external database ?

post everything related to phpwcms templates here
Post Reply
Vargas
Posts: 71
Joined: Thu 11. Nov 2004, 11:49
Location: Netherlands
Contact:

Pulling data from external database ?

Post by Vargas » Thu 30. Sep 2010, 15:42

Hi there,

I was wondering, is there any way to pull data from an external database and display the content of the fields in a CP ?
Or do i have to use own .php scripts to solve this ?
"I have a rude thought every 5 seconds. Thank God i'm a slow typer"

User avatar
Oliver Georgi
Site Admin
Posts: 9442
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau
Contact:

Re: Pulling data from external database ?

Post by Oliver Georgi » Sat 2. Oct 2010, 10:15

In general it is better to use custom a script based on phpwcms's framework features. I implement complex applications via frontend init/render by using functions like

Code: Select all

$mydata = _dbGet('mytable', '*', 'id='.$myid, 'fieldToBeGroupedBy', 'fieldToBeSortedBy', 10);
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Kleintierpraxis am Georgengarten

Vargas
Posts: 71
Joined: Thu 11. Nov 2004, 11:49
Location: Netherlands
Contact:

Re: Pulling data from external database ?

Post by Vargas » Sat 2. Oct 2010, 12:58

Thank you for your reply Oliver.
Until now i actually used external scripts to pull data into the CP.

But if i do understand you creect, it would be possible to create my own CP with de required fileds allready included ?
If that is right, i will give it a try for sure.
"I have a rude thought every 5 seconds. Thank God i'm a slow typer"

User avatar
Oliver Georgi
Site Admin
Posts: 9442
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau
Contact:

Re: Pulling data from external database ?

Post by Oliver Georgi » Sat 2. Oct 2010, 13:24

Yes, you can write your own module which integrates functionality very close into phpwcms including search support, content part. Or use just frontend render script to inject the phpwcms rendering process by using existing functions, db connection and so on.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Kleintierpraxis am Georgengarten

Post Reply