• Resolved slpbene

    (@slpbene)


    Hello,

    I like to read and edit the tables on serverside, eg. replacing some characters, insert new rows and looking for a project/library/code to achieve this.
    Does anybody has experiences, best practices or does know other tools or projects?

    Best,
    Bene

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Just to be sure, you are referring to TablePress tables here, or maybe more general (mySQL) database tables?

    For TablePress, there’s no specific functionality for this, you would have to use the internal PHP functions, as e.g. done in the class-controller-admin.php file.
    Now, that holds if you want your changes to be permanently saved. If you are more interested in making modifications before a table is rendered for the site visitor, you could use the available plugin filter hooks, see class-render.php.

    Regards,
    Tobias

    Thread Starter slpbene

    (@slpbene)

    Hi Tobias,

    Thanks for your reply. I was thinking about switching to a Database solution with ORM, but I think it is a bit oversized for our project and Tablepress suits our requirements in many ways, so I consider to write a solution from scratch for the reading & editing use case.

    Best,
    Benedikt

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ok, but if you are planning to rewrite the reading and editing part of TablePress with a custom storage, what exact features are you after then?

    Regards,
    Tobias

    I’m loving the pluging, thankyou.
    I need to read from the table that I have to used the scores in another php page. How can I do that?
    (No modification just reading data)
    EG: tableName: scores
    Player | Score
    Tester | 1
    Brian | 5

    $data = $_POST[‘Scores’]
    … loop through data if player==”Brian” …
    … echo Score …

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    yes, nice find! This should be a good solution for this kind of search problem ??

    Best wishes,
    Tobias

    Thread Starter slpbene

    (@slpbene)

    Hi,

    I think it’s mainly for utility and helper methods, do access data by criteria, sorting, …

    So mysql statements would allow that, but I want to keep Tablepress as it fits our requirements in many ways. I think I am going to write some helper classes using native php filtering, etc. This should be the best solution, as some of our use cases are very specific.

    Thanks for your help!
    Best,
    Benedikt

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ok, I see. Yes, it might be possible to just use the relevant features or classes then.

    Best wishes,
    Tobias
    ?
    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Read / Edit Table via PHP’ is closed to new replies.