Menu

#122 Add another column in the table

open
None
1
2023-02-16
2023-02-16
William
No

Good afternoon. I am trying to add more columns with their respective data in the following table that is generated when searching.
I want to add the name and phone number of the user who creates the appointment. Somebody could help me ? please

1 Attachments

Discussion

  • Campbell Morrison

    Assuming you are using the 'db' authentication type you'll need to modify the SQL query in search.php so that it's also joined with ther users table.

     
    • William

      William - 2023-02-16

      yes, use db authentication

       
    • William

      William - 2023-02-16

      This is the edition of the query, but when putting the padding in the table it gives an error

       
  • Campbell Morrison

    You'll need something like

      $sql = "SELECT E.id AS entry_id, E.create_by, E.name, E.description, E.start_time,
                     E.room_id, R.area_id, A.enable_periods, U.telfono_usuario
                FROM " . _tbl('entry') . " E
           LEFT JOIN " . _tbl('room') . " R
                  ON E.room_id = R.id
           LEFT JOIN " . _tbl('area') . " A
                  ON R.area_id = A.id
           LEFT JOIN " . _tbl('users') . " U
                  ON E.create_by = U.name
               WHERE $sql_pred
            ORDER BY E.start_time asc";
    
     

    Last edit: Campbell Morrison 2023-02-16
    • William

      William - 2023-02-16

      okay !

       

      Last edit: William 2023-02-16
    • William

      William - 2023-02-16

      I can't get it to show the results

       
  • Campbell Morrison

    You need to modify the function output_row().