WordPress.org

Ready to get started?Download WordPress

Forums

dbview
[resolved] Suddenly extra columns in view? (7 posts)

  1. SEOguruNL
    Member
    Posted 1 year ago #

    I suddenly get extra columns in my views, both in the administration panel and on the page:
    Name of View
    Public
    PHP Snippets
    SQL Query

    Why is that and how can I get rid of them?

    Thanks!

    http://wordpress.org/extend/plugins/dbview/

  2. john ackers
    Member
    Plugin Author

    Posted 1 year ago #

    Don't think I understand what has happened. What does your SQL look like? R U using any PHP snippets?

    Sorry but won't be able to investigate more until tomorrow PM.

  3. SEOguruNL
    Member
    Posted 1 year ago #

    I stepped over to writing a function myself using WP shortcodes. Thanks anayway!

  4. nicarley
    Member
    Posted 11 months ago #

    I am getting the same resulte. I have a table with some columns. IE here is my select statement:

    SELECT Contact, City, State, Zip, Phone, Website, Email FROM Dealer_List WHERE StateTerritory LIKE '%AK%'

    So I am showing all the contacts that are setup with AK in the table and displayed. I am not sure about PHP Snippts as I didn't want to insert them. If I run the query I also get the an error message:
    1 rows found.
    'name' is an orphaned PHP snippet. There is no matching column name.
    'v1' is an orphaned PHP snippet. There is no matching column name.
    'v2' is an orphaned PHP snippet. There is no matching column name.
    'v3' is an orphaned PHP snippet. There is no matching column name.

    Where the display shows Contact City State Zip Phone Website Email Name of view Public PHP snippets SQL query

    Except the last 4 I am not calling. If I select the run executed code check box, then I get the following in the last four columns return "" .substr($value,7). ""; $obj = unserialize($value);
    if (gettype($obj) != 'object')
    return "";
    return isset($obj->public) ? "on" : "-"; $obj = unserialize($value);
    if (gettype($obj) != 'object')
    return "";
    return isset($obj->cellFunction) ? count($obj->cellFunction) : "-"; $obj = unserialize($value);
    if (gettype($obj) != 'object')
    return("<span style='color:lightgrey'>Serialized object from DBView ver < 0.3, please save first.</span>");
    return esc_textarea(@$obj->query) ;. But I'm not trying to call those in my sql statement.

    Any ideas? Thanks.

  5. john ackers
    Member
    Plugin Author

    Posted 11 months ago #

    I think you have clicked on 'list views' which loaded that query for editing and then started modifying it. However it has PHP snippets attached to it.

    I would copy your SQL statement. Then start afresh by going into dbview again from the tools menu and pasting your SQL into the box. You should get what you want.

    The fault is mine. There really ought to be a create or new button to prevent this happening. Apologies. Let me know if this doesn't work.

  6. nicarley
    Member
    Posted 11 months ago #

    If I run the query is displays fine in the WP-Admin, but when I run the shortcode on a page it still displays the extra columns. Is there a way to take out the PHP Snippets? Or remove that from the plugin code?

  7. nicarley
    Member
    Posted 11 months ago #

    Actually, it did display correctly after I resaved it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.