filtering a database resukt before it was shown in the Table / problems to save all new datas

filtering a database resukt before it was shown in the Table / problems to save all new datas

zerennerzerenner Posts: 16Questions: 6Answers: 0

I'm new to web programming. So I want to use datatable to show different tables. I have a database table message and just want to select all messages that are identical to the session user ID. But I have trouble finding where and how to filter the message before a user can see the result.

I have a function in a PHP file for the selection (NachrichtenController.php) and an HTML file (Nachrichten.php) to display the result. I attached both files.

The second problem is that I can create a new line, but the sender and recipient user IDs are not saved.

Can I also provide the box for creating, updating, etc. with a headline in German?

Many thanks for your help.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    The documentation here describes how and where to apply a WHERE condition to your PHP Editor instance. In your php file you would do it just after the leftJoin statements, before the process() call.

    The second problem is that I can create a new line, but the sender and recipient user IDs are not saved.

    Can you link to the page showing the issue so I can take a look please?

    Allan

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    Hi Allan,

    that is not possible because its a project only in our network. i can give you only the hole project. I have no webspace for hosting a project.

    i can give you the database structure or screenshoots.

    Thank you.

    Dirk

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    Attach a PDF File withe two screenshots withe the problem with saving the ID:

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    The reason that English text is shown in the Editor form elements is that you have specified English text:

        $('#nachrichten').on('click', 'a.editor_edit', function (e) {
            e.preventDefault();
    
            editor.edit( $(this).closest('tr'), {
                title: 'Edit record',
                buttons: 'Update'
            } );
        } );
    

    Line 5 and 6 in the above are the text that is being shown. If you want that translated, change that text.

    As for the field values not being saved, you don't appear to have then as Field elements in your PHp script. You'd need to add Field::inst('nachricht.sender_id') for example.

    Allan

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    Hi Allan,

    thanks for your answers. I will try it in the evening.

    Dirk

This discussion has been closed.