inner join error on grid

Questionsinner join error on grid
caloyiv asked 8 years ago

i have an sql

$clid = intval($_GET["rowid"]);
>>> SELECT * FROM cl_list inner join student on cl_list.studentinfo_id = student.studentinfo_id WHERE fcltyid_id = $clid order by student.stdtlastname asc

this works fine with phpmyadmin but when i run it in the grid i get an error message..

4 Answers
Abu Ghufran answered 8 years ago

Can you explain what error is coming?
It is populating $clid variable in sql?

caloyiv answered 8 years ago

yes this is populating when i am using

>>SELECT * FROM cl_list WHERE fcltyid_id = $clid

i get this from firebug

500 internal server error

_search false
fcltyid_id 1
grid_id view_cl
jqgrid_page 1
nd 1446090470056
rowid 1
rows 20
sidx cl_id
sord desc
view_load

caloyiv answered 8 years ago

it will not give error if i will remove

>>order by student.stdtlastname asc

Abu Ghufran answered 8 years ago

ahan, ok.
You should remove order by from sql query and add order by settings in:

Sort grid by this field, Sort ASC or DESC

$grid["sortname"] = 'student.stdtlastname';
$grid["sortorder"] = "asc";

$g->set_options($grid);

Your Answer

1 + 14 =

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?