Search in grid not working when i'm using inner join in query

QuestionsSearch in grid not working when i'm using inner join in query
Aman Goyal asked 10 years ago

Hello,

search is not working when I'm using inner join on query.
below is query
$g->select_command = "select CONCAT(employee.firstname, ' ', employee.lastname) as emp_id, CONCAT(student.first_name, ' ', student.last_name) as student_id,tech_stu.assgn_status as assgn_status,tech_stu.id as id from tech_stu inner join employee on tech_stu.emp_id=employee.emp_id inner join student on tech_stu.student_id=student.student_id";

1 Answers
Abu Ghufran answered 10 years ago

You need to set 'dbname' property when using function on fields.
e.g. with column emp_id set

$col["dbname"] = "CONCAT(employee.firstname, ' ', employee.lastname)";

This way, dbname will be used in WHERE clause and not your alias.

Your Answer

19 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?