grid load data mysql and another

Greetings, I have a question, I am currently loading my grid directly to mysql with a table, but my grid must contain additional fields that are not on the table. It could display these fields that are not on the table in the grid?, What I do is load from a table some fields and not others. could be done? how? or is it impossible?. thank you very much everyone

where are your additional fields from come?

For example: in my table: Name, address, in my grid I have name, address, number. number must have a value of 0, but how to assign value to that column

You can use rende_sql method:

$grid->render_sql(“select id, name, address, 0 as dummy from some”, “id”, “id,name,dummy”)


I am trying this technique but when I update the table the error log tells me

"message: Invalid column name 'dummy'. (severity 16) in D:\PVHMCWEB\misc_apps\application_libraries\dhtmlx_2.6\db_mssql.php on line 12"

I know what the issue is, there is no column in my table named dummy, but I don’t know how to resolve it. This is a “static” dummy column that I don’t need to update.


Nevermind, I got it using the if($grid->is_select_mode()) {