client.connect() fails except the first time I am communicating with the Web server's database via Arduino GSM shield + GPRS connectivity

void loop() 
{
  if (client.connect(server, port)) 
     { 
       ....... 
      }
  else 
     { 
      Serial.println("Server not found"); 
      } 
  delay(1000); 
}


The first time when the loop() runs in the serial port, the code works perfectly and stores in my server's db. The second time when the loop() runs after some delay, It is unable to connect to the server and results "server not found" . I don't know what is the problem.

Please let me know if there is a way to connect continuously. Thank you
You have to disconnect before being able to connect again otherwise the controller will crash due to memory starvation. Every connect you do takes some memory to register state information. Not sure of the exact commands involved, but it'd look a bit like this:

   if (client.connect(server, port)) 
     { 
       ....... 
       client.disconnect( .... );
      }
  else 
........


Alternatively you can check if you are already connected, and only do a reconnect when necessary, but I don't know which library you are using, let alone if there is a proper check available in it.