Link to home
Start Free TrialLog in
Avatar of Pigdogmonster
Pigdogmonster

asked on

If Statement

I want to run an if Statement on a SQL count from a database:


sql34 = "select count (ShipNum) AS counter from shipData";
int c = rs34.getInt("counter");


//The count itself works fine but I want to add the following IF statement.

if (c = 0) {
      
      Out.println("<center><font size='4' color='red'><b><i>There are no records in our database that match your search Criteria");
      
}

But this fails - what am I doing wrong?!
Avatar of jarasa
jarasa
Flag of Spain image

Try this:

if (c == 0) {

Javier
Avatar of Pigdogmonster
Pigdogmonster

ASKER

I get 1 error now:-

com.inqmy.services.servlets_jsp.server.jsp.CompilingException: ID17013: e:\sap\SAP_J2EEngine6.20\cluster\server\services\servlet_jsp\work\jspTemp\_$SAP_J2EE_Engine_default_context\work\jsp_sortASC1080304023812.java:879: cannot resolve symbol
symbol  : variable Out  
location: class jsp_sortASC1080304023812
      Out.println("There are no records in our database that match your search Criteria");
        ^
1 error
ASKER CERTIFIED SOLUTION
Avatar of jarasa
jarasa
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial