[Plugin: DB Toolkit] Problem with dbtoolkit plugin
-
I downloaded and installed your plugin. i can edit the table from my wp database, but i have not undertand how to view all data like a query SELECT * FROM [Table_name]. Can you tell me how ti filter data in report mode like a query SELECT * FROM [Table_name] WHERE [item]=[value]?
It is possibile to create e report and replace a integer value with a image URL?Thanks Enrico
-
Hi Enrico, Sorry for the late reply.
I am busy working on documentation but as you can imagine its very complex. I am also planning on doing some video tutorials. so hang in there.
as for your question.
the simple approach is to create a new interface. select the table and then configure each field type. (you can do this by clicking the “auto” button you should get a whole list of field types in a drop down. next to this button theres a dropdown that says things like “shown indexed” Shown means its visible in the report and indexed means its added to the filters box. once you have done this, simple click create/save. now click on the view link below the interface name. this should give you a full report of all the data. now depending on the field types you selected, you’ll have various filter inputs for the fields in your table. if you selected a field for say an enum, you should get a dropdown selector for all the enum values available. entering a value on one of these field filters essentially adds your “WHERE item=value”
for your image url option, there is no field type currently for URL Image but there is one for imae upload field, which allows you to set your thumbnail sizes and gives you an upload box in insert.
I will post back here once I have documentation up and some videos.
Please just play around with the plug-in for now.
~ David
I have started doing a tutorial series to explain the fundermentals in using the system – see them on https://dbtoolkit.digilab.co.za/
I’ve been struggling to get this plugin to work. It seems to have a lot of promise, but I keep running into spots where it doesn’t work in non-obvious ways.
So at the moment, I have an interface set up for a very simple 3-field table. When I try to use it to add a new record, it redirects to /wp-admin/admin-ajax.php and just shows “-1”, and the record is NOT added. Is there some kind of trick to making that work?
Also, the “auto” field type didn’t work at all, they just showed up blank in the add new form, I had to change it to the single text field type.
hey there-
the plugin is still in a lot of development so hang in there -it will come right soon.tell me what version of the plugin are you running?
With the Auto field type. I think I know where your going wrong and its my fault. Auto sounds like its going to Automatically detect the field type but that’s not what it does. Auto is for Auto increment.
its also used if you dont want to capture a value since it doesnt give a form field. All fieldtypes need to be defined by you. so if its a date field you need to select the date picker.But you have a very good point. I do need a auto detecting field type and will look into doing that.
please let me know what version you have and I’ll help you get it working.
Hi,
I’m using version 0.1.14 (is that not the latest?). I’m building a web site for a soccer organization, and I’m trying to use it to provide a list of soccer field directions. I have pre-filled a table with soccer field name, latitude, and longitude. I also made a view, which has just 2 fields, a soccer field name and a URL to Google Maps to get directions (which I construct from name, lat, lon).
The goal is to have an admin-side form that we can use to edit the list of fields, as well as have public-side functionality to browse the list and search for fields.
yes 0.1.14 is the latest available.
have you constructed a form using the form layout tab and did you select ajax forms?
I have the form constructed, it has 3 fields: name, lat, lon. Also got the Ajax box checked. When I try to input a new record, I get that -1 page.
Also, for reference, my table structure is:
CREATE TABLE
fields
(
name
varchar(80) NOT NULL,
lat
float default NULL,
lon
float default NULL,
PRIMARY KEY (name
)
) ENGINE=MyISAM DEFAULT CHARSET=latin1ok table structure is fine. however i would recommend you adding a auto-increment FieldID field and set that as your primary rather than having the varchar name as primary.
indexing a varchar is a little slower and using the FieldID for referencing will be alot easier and faster.
I know there are problems with the ajax forms so go an uncheck that. I have removed this option in the next version for now until i can get it working properly.
For your form I would recoment adding the fieldID as mentioned. then edit the interface, uncheck ajax forms in the form layout tab, then set the fields to:
FieldID: Auto, hidden-indexed
name: Single Line Text, Shown-Index, required
lat: Single Line Text, Shown-Index, required
long: Single Line Text, Shown-Index, requiredthen save.
Give that a try and let me know how it goes.
~ Davidfor reference – use this structure.
CREATE TABLE fields ( fieldID int(10) unsigned NOT NULL AUTO_INCREMENT, name varchar(80) NOT NULL, lat float DEFAULT NULL, lon float DEFAULT NULL, PRIMARY KEY (fieldID) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=101 ;
I am not clear on the button meaning for the unique/required/sortable toggle buttons. Specifically, does the red ring around it mean it’s enabled or disabled?
yes red ring means enabled. maybe i should have made it green.
unique = when you fill in a field it will check with the db that it is a unique entry. so you can have to entries with the same name if name is unique.
Required = form wont submit unless the field is filled in.
sortable = in a list view this field column can be clicked to sort by it.
Ok, I had the button meanings backwards. So, given that:
1. I recreated the table layout by copy/pasting your create statement and then re-filled it from a backup table.
2. I set the 4 fields as you described in the form builder, and disabled Ajax. I also made name unique and sortable. I also removed a passback field that I noticed was there.
When I hit that darned submit button, it still lands on /wp-admin/admin-ajax.php, even with the Ajax button unchecked.
To research deeper, I looked into my server logs (I use nginx for performance reasons), and found this:
PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0" while reading upstream, client: **IP ADDRESS**, server: **HOST NAME**, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "**HOST NAME**", referrer: "https://**HOST NAME**/wp-admin/admin.php?page=Database_Toolkit&renderinterface=dt_intfc4cf13e14ab82d"
Doing some digging, I realized it was a server-side permissions issue in that my php session directory was not writable by my web server. Once I fixed that, all of a sudden the insert started working. I bet it will fix other strangeness as well. So now I can keep playing with this!
Great! I’m glad its working.
I use sessions as it the easiest way i know of to pass values from one interface to another without clogging up the address bar.Thanks for pointing out that if sessions arent setup properly it can cause issues.
Please feel free to shout out if you have any other problems.
~ David
- The topic ‘[Plugin: DB Toolkit] Problem with dbtoolkit plugin’ is closed to new replies.