I want add data into solr. i wrote below code for that

Please give me the solution for that ASAP

<!--TEST--
SolrClient::addDocument() - Sending a single document to the Solr server
--SKIPIF-->
<?php require_once 'skip.if.server_not_configured.inc'; ?>
<!--FILE-->
<?php
error_reporting(E_ALL);

require_once "bootstrap.inc";
require_once "connect.php";


$options = array
(
'hostname' => SOLR_SERVER_HOSTNAME,
'login' => SOLR_SERVER_USERNAME,
'password' => SOLR_SERVER_PASSWORD,
'port' => SOLR_SERVER_PORT,
'path' => SOLR_SERVER_PATH."core2",

);





$sql=mysql_query("select * from infolinenews news inner join infolinedetaildnews detail on news.newsid = detail.newsid");

$i=1;
while($rem=mysql_fetch_array($sql, MYSQL_BOTH)){
$client = new SolrClient($options);
$doc = new SolrInputDocument();

$doc->addField('newsid', $rem['NewsId']);
$doc->addField('sno', $rem['Sno']);
$doc->addField('sectionid', $rem['SectionId']);
$doc->addField('subsectionid', $rem['SubsectionID']);
$doc->addField('section_name', $rem['Section_Name']);
$doc->addField('arttext', $rem['Arttext']);
$doc->addField('imageurl',$rem['Imageurl']);
$doc->addField('dateofcreation', $rem['Dateofcreation']);
$doc->addField('dateofupdate', $rem['Dateofupdate']);
$doc->addField('dateofpublish', $rem['Dateofpublish']);
$doc->addField('time', $rem['time']);
$doc->addField('keyword', $rem['keyword']);
$doc->addField('caption', $rem['Caption']);
$doc->addField('creatorname', $rem['CreatorName']);
$doc->addField('createdby', $rem['CreatedBy']);
$doc->addField('inactive', $rem['isactive']);
$doc->addField('inarchived', $rem['isarchived']);
$doc->addField('heading', $rem['heading']);
$doc->addField('sector_name', $rem['Sector_Name']);
$doc->addField('co_code', $rem['co_code']);
$doc->addField('activetopnews', $rem['ActiveTopNews']);
$doc->addField('infocus', $rem['InFocus']);
$doc->addField('shorttitle', $rem['ShortTitle']);
$doc->addField('newsdate', $rem['NewsDate']);



$updateResponse = $client->addDocument($doc,false,1);
print_r($updateResponse->getResponse());

unset($client);
unset($doc);
$i++;
//$client.add($doc);
//$client.commit();
}




?>