[TYPO3-dev] extra helper files in plugin -> how to access db ?

Henjo Hoeksma hphoeksma at stylence.nl
Wed Jan 28 21:15:09 CET 2009


On 2009-01-28 21:03:46 +0100, Dmitry Dulepov <dmitry at typo3.org> said:

> Hi!
> 
> Henjo Hoeksma wrote:
>> I have written a custom plugin using the google api.
>> This plugin uses the method of building an on-the-fly xml file with the
>> result of the search for correct addresses.
>> The pi1 class at some point calls to the external xml file in order to
>> retrieve the data.
>> 
>> I couldn't find how to have this extra file (which resides in the folder
>> pi1/scripts) load the default dbase variables so it's in there 'hard'.
>> It's not a class.
> 
> Do you mean you want xml file to load something? xml is data, not 
> executable code.

Hi Dmitry,

thank you for your response.

The php code code creates the xml data as output using 'echo $dom->saveXML();'.
The content of this XML is coming from the database.

The pi1 class accesses this XML to retrieve the correct data.
In order to have the correct data in the XML it needs to access the DB. 
Which I now did by making the connection the normal php way (using 
mysql_connect() ). The variables for the db, user and host are in this 
file too - which I'd like to not have but have it come from within 
TYPO3...

Hope this is more clear. I am making my first steps in this so I am 
sorry if I am somewhat confusing in my description!

Henjo


-- 
Stylence | webdevelopment in style
http://www.stylence.nl





More information about the TYPO3-dev mailing list