Hi,
Can anyone give me some tips on how to connect an external MySQL db to mediawiki?
I need to display some contents from an external database in a mediawiki page. The contents of the external database will change independently of the wiki and no one shall be able to write to the external db from the wiki pages. Thanks.
Bin
One approach: Write a custom tag (say, <mydatabase>) that hits your database using the API at http://us.php.net/mysql and returns results. For example, <mydatabase>select foo, bar from blat</mydatabase> could produce an HTML table of the results, with the column names (foo, bar) as the table headings.
DanB
Thanks! This solved my problem.
Regards, Bin
On Mar 18, 2008, at 2:06 PM, Daniel Barrett wrote:
One approach: Write a custom tag (say, <mydatabase>) that hits your database using the API at http://us.php.net/mysql and returns results. For example, <mydatabase>select foo, bar from blat</mydatabase> could produce an HTML table of the results, with the column names (foo, bar) as the table headings.
DanB
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Be careful with permissions using this approach, of course!!
On Mar 18, 2008, at 4:06 PM, Daniel Barrett wrote:
One approach: Write a custom tag (say, <mydatabase>) that hits your database using the API at http://us.php.net/mysql and returns results. For example, <mydatabase>select foo, bar from blat</mydatabase> could produce an HTML table of the results, with the column names (foo, bar) as the table headings.
DanB
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
Thanks.
Do you know any good documentation of mediawiki? I found the documentation in meidawiki project website a little difficult to follow. I want to customize mediawiki as part of an existing database- driven site written in PHP.
Regards, Bin
On Mar 20, 2008, at 9:36 AM, Jim Hu wrote:
Be careful with permissions using this approach, of course!!
On Mar 18, 2008, at 4:06 PM, Daniel Barrett wrote:
One approach: Write a custom tag (say, <mydatabase>) that hits your database using the API at http://us.php.net/mysql and returns results. For example, <mydatabase>select foo, bar from blat</mydatabase> could produce an HTML table of the results, with the column names (foo, bar) as the table headings.
DanB
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hello !
I have a problem with my mediawiki site on a debian etch server.
Seems that the template parser _randomly _"crash" and don't parse correctly data. As a result i often have on the footer "about {{sitename}}" in place of "about myrealsitename". After having this bug or not if i refresh the page the result can randomly be the same.
I had this problem by using the debian official package v 1.7 and the manually installed v 1.11.2 (after removing the official debian package).
Someone have already this nasty problem ?
In a other way i would ask you if there is a workaround to install imagemagick on a server without the all the X dependencies...
I use the dbr/dbw convention and have tell it to switch databases to the external db in the extension.
$dbr =& wfGetDB( DB_SLAVE ); $dbr->selectDB($yourexternaldatabase);
This lets me use MW's built-in db access methods. It took me a while to learn how to do this, but it was worth it. It may be overkill if all you want is SELECT, and when I wrote my first extension, I just used the php mysql functions directly.
Jim
On Mar 20, 2008, at 4:07 PM, Bin Hu wrote:
Thanks.
Do you know any good documentation of mediawiki? I found the documentation in meidawiki project website a little difficult to follow. I want to customize mediawiki as part of an existing database- driven site written in PHP.
Regards, Bin
On Mar 20, 2008, at 9:36 AM, Jim Hu wrote:
Be careful with permissions using this approach, of course!!
On Mar 18, 2008, at 4:06 PM, Daniel Barrett wrote:
One approach: Write a custom tag (say, <mydatabase>) that hits your database using the API at http://us.php.net/mysql and returns results. For example, <mydatabase>select foo, bar from blat</mydatabase> could produce an HTML table of the results, with the column names (foo, bar) as the table headings.
DanB
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
thanks! Bin
On Mar 24, 2008, at 7:44 AM, Jim Hu wrote:
I use the dbr/dbw convention and have tell it to switch databases to the external db in the extension.
$dbr =& wfGetDB( DB_SLAVE ); $dbr->selectDB($yourexternaldatabase);
This lets me use MW's built-in db access methods. It took me a while to learn how to do this, but it was worth it. It may be overkill if all you want is SELECT, and when I wrote my first extension, I just used the php mysql functions directly.
Jim
On Mar 20, 2008, at 4:07 PM, Bin Hu wrote:
Thanks.
Do you know any good documentation of mediawiki? I found the documentation in meidawiki project website a little difficult to follow. I want to customize mediawiki as part of an existing database- driven site written in PHP.
Regards, Bin
On Mar 20, 2008, at 9:36 AM, Jim Hu wrote:
Be careful with permissions using this approach, of course!!
On Mar 18, 2008, at 4:06 PM, Daniel Barrett wrote:
One approach: Write a custom tag (say, <mydatabase>) that hits your database using the API at http://us.php.net/mysql and returns results. For example, <mydatabase>select foo, bar from blat</mydatabase> could produce an HTML table of the results, with the column names (foo, bar) as the table headings.
DanB
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org