Announcement

Collapse
No announcement yet.

Parse error: syntax error, unexpected '{' in C:\NetMake\v8\wwwroot\scriptcase\app\edu

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Parse error: syntax error, unexpected '{' in C:\NetMake\v8\wwwroot\scriptcase\app\edu

    Hi

    I have been struggling to fix the above issue but not sure what is the issue. I have a control form and in the init event i have the following steps

    {Student_ID}=[student_id];
    {SchoolName} = [institute_name];
    {EducationSystem} = [education_system];
    {Class}=[class_name];
    {SectionName} = [section_name];
    initialize_fees();

    In the initialize_fees php function; i have the following code


    $sql = "select feespaid_id from fees_paid where STUDENT_ID=".[usr_id]. " AND ACADEMIC_YEAR_ID=".
    [academic_year_id]. " AND FEE_STRU_CLASS_ID IN (SELECT FEE_STRU_CLASS_ID FROM
    fee_struc_class WHERE CLASS_ID=".[class_id].")";

    sc_lookup(rs, $sql);

    echo $sql."<br />";

    if(count({rs}) == 0)
    {
    /**
    * Insert a record on another table
    */
    $sql = "select FEE_ID, FEE_STRU_CLASS_ID from fee_struc_class where CLASS_ID=". [class_id];

    echo $sql."<br />";

    sc_lookup(rs, $sql);

    $ctr=0;
    $totrecs=count({rs});

    /*if ($totrecs==0)
    {
    $error_message = 'fee struc class table is empty!';
    sc_error_message($error_message);
    }*/

    while ($ctr <= $totrecs)
    {
    if ($totrecs>0)
    {
    $fee_id={rs[ctr][0]};
    $fee_stru_class_id={rs[ctr][1]};

    $fee_detail_id='';

    $feedetailsql="select FEEDETAIL_ID from fee_details where FEE_ID=". $fee_id.
    " AND CLASS_ID=". [class_id];

    sc_lookup(rsd, $feedetailsql);

    $ctrdetail=0;
    $totdetrecs=count({rsd});

    while ($ctrdetail < $totdetrecs){
    if ($fee_detail_id=='')
    {
    $fee_detail_id={rsd[$ctrdetail][0]};
    }
    else
    {
    $fee_detail_id=$fee_detail_id."~".{rsd[$ctrdetail][0]};
    }
    $ctrdetail++;
    };

    sc_set_global($fee_detail_id);
    sc_set_global($fee_id);
    sc_set_global($fee_stru_class_id);

    $error_message = $fee_detail_id.' Fee details.'; // Error message

    sc_error_message($error_message);

    //insert_records();

    }

    $ctr++;
    }
    }

    for some reason when I run the program (called from other program) I am getting the below error

    Parse error: syntax error, unexpected '{' in C:\NetMake\v8\wwwroot\scriptcase\app\eduManagement \control_Pay_Fees\control_Pay_Fees_apl.php on line 2186

    When I open the control_Pay_Fees_apl.php i see that the error is after the if statement {. I am not sure what I am doing wrong here. Any help will be highly appreciated.

    while ($ctr <= $totrecs)
    {
    if ($totrecs>0)
    {

  • #2
    These errors are hard to find. First remove the comment. The fact that { and }are used there might confuse the scriptcase parser. If that doesn't work then strip your application and build it up again step by step to see when it goes wrong.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment

    Working...
    X