Unknown column 'I' in 'where clause'


I am trying to do a summation (totals) on a column feescollected. I am getting an error listed below:
Error
Error while accessing the database:
Unknown column ‘I’ in ‘where clause’
select count(*), sum(FeesPaid) as sum_feespaid from feescollected where Student = 4 and TermPaidFor = I

Script: C:\Program Files (x86)\NetMake\v8\wwwroot\scriptcase\app\Testproject\grid_feescollected\grid_feescollected_total.class.php (127)

the correct sql querry should have “I” at termPaidFor = “I” instead of TermPaidFor = I
Though i’ve seen a similar problem on this forum, i dont know where to make the correction in the sql while in scriptcase
Can somebody help out?

Hello,

Go into your application and enable debug mode (Application> Settings> Debug Mode - Yes)

If you can see where the error and correct it will be great.

After that send me a picture of the problem so that I can analyze.

Thank you!

[QUOTE=Thomas Soares;30488]Hello,

Go into your application and enable debug mode (Application> Settings> Debug Mode - Yes)

If you can see where the error and correct it will be great.

After that send me a picture of the problem so that I can analyze.

Thank you![/QUOTE]

I’ve emailed you. The same details as in emails are below:

(pdo-mysql): select count(), sum(FeesPaid) as sum_feespaid from feescollected (pdo-mysql): SELECT FeesCollectedID, Student, PaymentModID, Ref, FeesPaid, DatePaid, TermPaidFor from feescollected order by Student asc, TermPaidFor asc LIMIT 0,12 (pdo-mysql): select count(), sum(FeesPaid) as sum_feespaid from feescollected where Student = 4 (pdo-mysql): SELECT concat(Surname, " , ", Others) FROM students where StudentsID = 4 order by Surname, Others (pdo-mysql): select count(*), sum(FeesPaid) as sum_feespaid from feescollected where Student = 4 and TermPaidFor = I 1054: Unknown column ‘I’ in ‘where clause’

           ADOConnection._Execute(select count(*), sum(FeesPaid) as sum_feespaid from feescollected  where Student = 4 and TermPaidFor = I, false) % line 1085, file: adodb.inc.php
        ADOConnection.Execute(select count(*), sum(FeesPaid) as sum_feespaid from feescollected  where Student = 4 and TermPaidFor = I) % line  125, file: grid_feescollected_total.class.php
     grid_feescollected_total.quebra_termpaidfor_Student_Term(4, I,  = 4,  = I) % line 2486, file: grid_feescollected_grid.class.php
  grid_feescollected_grid.quebra_termpaidfor_Student_Term(4, I) % line  715, file: grid_feescollected_grid.class.php

grid_feescollected_grid.inicializa() % line 104, file: grid_feescollected_grid.class.php

Error
Error while accessing the database:
Unknown column ‘I’ in ‘where clause’
select count(*), sum(FeesPaid) as sum_feespaid from feescollected where Student = 4 and TermPaidFor = I

Script: C:\Program Files (x86)\NetMake\v8\wwwroot\scriptcase\app\Testproject\grid_feescollected\grid_feescollected_total.class.php (127)

I suggest you view the source code from grid_feescollected_total.class.php around line 127 and paste that here as well (a few lines before it as well).