I am looking for a database plugin to use within WordPress, for the purpose of display of tabular data. The ability to do links from a cell would be valuable also. It is difficult to search for such a plugin in the WordPress plugin list, since “database” matches many other things that are specific to the WordPress database.
Does anything like this exist? Certainly MySQL is capable of handling the data I want to display; I’d like WordPress to utilize a MySQL database.
I think I am looking for the same thing – but want to clarify (if you don’t mind my hijacking this post)
I use wordpress to display data that is pulled from a mySQL database (separate from the WP database) and am developing an admin interface for a client that will allow them do simple entry editing, deleting, updating from the admin page.
Before I put too much time into this – does anyone know of a similar plugin — a VERY-simple WP admin pages version of phpMyadmin that I could hack to my bidding?
@sweyhrich – after rereading your post – it looks like maybe you just want to display data… that is a simple matter of using php mysql functions like mysql_query, mysql_fetch_array and then echo the results. There are many tutorials on this. Google the above terms.
I wrote a plugin that I could “genericize” for your use if you are interested. It provides functions to:
1) insert a simple DB table into your posts or pages,
2) Update, add, delete entries in the database via the admin pages
If anyone is interested, please let me know. Its simple – just took a few hours of hair-pulling to make it all work right.
Off to test it with 2.7 (crossing fingers).
Great – hope some people find it useful.
I am hopping internet cafes in Laos right now, so don’t have a lot of time to upload it at the moment… I’ll get it up by the end of the week though.
In the meantime, feel free to leave your e-mail and I can send you the ZIP file.
Hey Driftless, I could really use it! Email me if you have it available. brandonchopkins @ gmail
Finally squared things away – as far as I know. There may be an odd bug or two (as is the case with these things). You can find the plugin here:
And please, if you do find errors, or have suggestions for improvements, please leave a note here, or send me an email.
Does anyone have a success story about the use of his plugin?
@sitesby — Aside from my own implementation, I haven’t heard – but you can look here:
to see an example of possible output…
In the back-end there is a very simple admin page that allows users to Add, Edit, and Delete entries. It has been working well so far, and keeps the data in a completely separate DB than WordPress. Not just a table inside the wordpress DB — possibly overkill depending on your needs.
I’ve added your plugin but I’m embarassed to say that I can’t figure out how to use it!
I’ve followed the directions in your README and do see the External DB management link on the left hand side of WP’s admin page . . . but I can’t figure out how to add this great table to a blog post!
Can you point me in the right direction?
@livetotry — Thanks for giving it a whirl.
It is difficult to know where you are at in the process. If you have set up the config.php file correctly to point to your DB (or a test like the example one included) and have adjusted the admin.php file to fit your needs (none needed if using the example DB) then you can use the hook <?php insert_ext_db_table() ?> to produce the table on your site.
Note: the hook will only work if it is inserted in a template, OR if you have php enabled in your posts by using http://wordpress.org/extend/plugins/exec-php/ or similar. I have not used these, I put the hook directly in a template, so I cannot vouch for them.
If you would like more specific help, please feel free to contact me privately via the email listed at lbell270.com or post more info here.
I’m trying to use your external db plugin too, but I’m getting a bit lost.
I created a MySQL db in my hosting account, and changed the db_manager_config.php to show the correct db name, user and password. I uploaded the plugin and activated it, and I’ve imported the db_manager_sample_db.sql file and the db is populated with the five records.
I’ve put the php code “<?php insert_ext_db_table() ?>” onto one of my pages (also tried putting it in a template file) but in both cases it fails to connect to the db and I get the error message:
Sorry, we can not connect to the database at this time. Please try to refresh. If the problem persists, please contact the administrator. Thank you.
I tried uploading the exec-php plugin, but that makes no difference, and I also uploaded the php code widget (http://wordpress.org/extend/plugins/php-code-widget/) but again it fails to connect.
Any idea what I’m doing wrong?
Aha!! I changed the first line from ‘localhost’ to the actual IP address and now it’s working!
Next thing now is – I have put the php code into the template, but that means that it’s displaying the contents of the db on all pages. How do I get it to display on just one page? If I enter the line of php code in HTML view on the page, it doesn’t work (sorry if I’m doing something really silly there, but I’m new to both WP and php).
What to do next?
Glad its working for you –
As for the issue of how to put it in your template, you can use several methods (working from memory here):
1) Insert it directly into a post (using the exec-php plugin)
2) Create a unique page template (see http://codex.wordpress.org/Stepping_Into_Templates and/or http://codex.wordpress.org/Template_Hierarchy ) and assign the page you want the DB
3) Use conditionals in your template ( http://codex.wordpress.org/Conditional_Tags ):
<?php if(is_page('my-database-whatever'))insert_ext_db_table() ?>
Should work – though double check that…
- The topic ‘Database plugin for WordPress’ is closed to new replies.