This topic is locked

the auto created 'ORDER By' make slowly of my project in 213

6/30/2009 4:44:41 AM
PHPRunner General questions
L
ljmjava author

I have use 5.0 for a month and try to create some code of my databases; it is fine and can run like fly.

But when I try 5.1 today.........

I found the 5.1 program changes the SQL language in a wrong way: it auto create a "group by " language of the list query/
such as:

in 5.0:
SELECT id, mobile, long_num, ext_num, sms_content, user_id, task_id, crt_time, report_time, report, report_notify_result, channel_id, report_code_nsk, report_nsk, report_code, link_id FROM sms_mt ORDER BY crt_time DESC
in 5.1 :

SELECT id, mobile, long_num, ext_num, sms_content, user_id, task_id, crt_time, report_time, report, report_notify_result, channel_id, report_code_nsk, report_nsk, report_code, link_id FROM sms_mt ORDER BY 8 DESC, 1 ASC
SEE it?!!
the" ORDER BY 1 ASC" is magic add by 5.1!
Is it a bug or somebody like to make it?

Is make slowly my program in fact!

So if this question can not be resove. Iwill not use 5.1 anymore.

J
Jane 7/1/2009

Hi,
It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

L
ljmjava author 7/1/2009

It is very easy to see what I said.

Just new a project on any table.

When you create a "List" page, change the include file dbcommon.php the " Debug=true"

to print the sql language,

You will find after the "select * from anytable" is a "ORDER BY 1 ASC", the default added order by sql.

So I had to say ,maybe some one make it for clever, But it truly make my list page too slowly.

Can any body tell me how to remove it?

J
Jane 7/1/2009

Hi,
try to do this one:

  • open generated ..._list.php file,
  • find this code:
    if($lenArr > 0)

    {

    for($i=0;$i<$lenArr;$i++)

    $strOrderBy .=(GetFieldByIndex($arrFieldForSort[$i]) ? ($strOrderBy!="" ? ", " : " ORDER BY ").$arrFieldForSort[$i]." ".$arrHowFieldSort[$i] : "");

    }



and replace it with this one:

if($lenArr > 0)

{

for($i=1;$i<$lenArr;$i++)

$strOrderBy .=(GetFieldByIndex($arrFieldForSort[$i]) ? ($strOrderBy!="" ? ", " : " ORDER BY ").$arrFieldForSort[$i]." ".$arrHowFieldSort[$i] : "");

}

L
ljmjava author 7/5/2009

Is it a bug? or wil be added to the next patch?

L
ljmjava author 7/6/2009

This cannot help me.

I use the change code,now get this:

---------From:---------

SELECT id, mobile, long_num, ext_num, sms_content, user_id, task_id, crt_time, report_time, report, report_notify_result, channel_id, report_code_nsk, report_nsk, report_code, link_id FROM sms_mt ORDER BY 8 DESC, 1 ASC

-------TO:-------

SELECT id, mobile, long_num, ext_num, sms_content, user_id, task_id, crt_time, report_time, report, report_notify_result, channel_id, report_code_nsk, report_nsk, report_code, link_id FROM sms_mt ORDER BY 1 ASC
It removed the "8 DESC" for "crt_time desc", But I want remove the "1 ASC" of "ID ASC".

J
Jane 7/6/2009

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

L
ljmjava author 7/7/2009

Here it is.
ID Subject Messages Updated
185387 about the auto created "ORDER By" error 1 7/7/2009 3:06:29 AM