Menu

#13 Form view never shows the content

open
nobody
None
5
2014-09-26
2012-09-10
Anonymous
No

Discussion

  • Anonymous

    Anonymous - 2012-09-10

    I use MySQL. Upon investigating, I found that it is probably due to a bug in vfront-0.96c/rpc.php where the name of the tables are not between ` and the ordering parameter being shown twice.

    The database log shows

    SELECT * FROM cases ORDER BY index ASC,index ASC LIMIT 1

    with the message

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index ASC,index ASC LIMIT 1' at line 1

    The correct syntax (according to MySQL documentation) should be

    SELECT * FROM `cases` ORDER BY `index` ASC LIMIT 1

    /rpc.php:253

     
  • Anonymous

    Anonymous - 2012-09-10

    The above issue is in "form view". In "grid view", the SQL query is

    SELECT index as pk, index,date,district,panchayat,place,contact_name,contact_email,contact_phone,contact_org,source,case_issue,project_name,land_type,info_source,details,number_villages,state,case_number FROM cases t1 ORDER BY index ASC LIMIT 20

    and the error message is

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index as pk, index,date,district,panchayat,place,contact_name,contact_email,cont' at line 1

    /rpc.xmlgrid.php:308

     
  • Anonymous

    Anonymous - 2012-09-20

    I fixed it.

    in vfront-0.96c/inc/func.frontend.php, line 1030

    $string_orderby.=$orderby_a[$i]." ".$orderby_sort_a_string.",";

    should be replaced by

    $string_orderby.="`".$orderby_a[$i]."` ".$orderby_sort_a_string.",";

     
  • Marcello Verona

    Marcello Verona - 2014-09-26

    This is a MySQL only fix. Probably the field name is not SQL standard (it contains spaces or other not-standard chars)

     

Log in to post a comment.