Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for($i=0;$i<count($dirlist);$i+=1)
- {
- // echo($dirlist[$i]);
- // echo('<br>');
- $xml = simplexml_load_file($dirlist[$i]);
- // echo ("Title " .$xml->NodeId );
- $nodeID = $xml->NodeId;
- $src_Lang = $xml->SrcLang;
- $tar_Lang = $xml->TarLang;
- $myArray = explode(',', $tar_Lang);
- $first = $myArray[0];
- $node_title = $xml->NodeTitle;
- $node_body = $xml->NodeBody;
- //select nid from table where nodeiD = 5 ,file id=88,project id =99
- $result = db_query("SELECT * FROM {freeway}
- WHERE node_id = '$nodeID'
- AND src_lang ='$src_Lang'
- AND tar_lang='$first'
- AND project_id ='$pidobtained'");
- while ($record = db_fetch_object($result))
- {
- $serial_id = $record->sr_id;
- if(!strlen($serial_id) == 0){
- echo('Test1');
- echo'<br>';
- db_query("UPDATE {freeway} SET node_id ='$nodeID',file_id ='$fileIdbtained',project_id='$pidobtained',src_lang = '$src_Lang',tar_lang='$first',node_title='$node_title',node_body='$node_body' WHERE sr_id='$serial_id'");
- }
- else{
- echo('Test2');
- echo'<br>';
- db_query("INSERT INTO {freeway} (node_id, file_id,project_id,src_lang, tar_lang, node_title, node_body) VALUES ('$nodeID','$fileIdbtained','$pidobtained','$src_Lang','$first','$node_title','$node_body')");
- }
- }
- if(!($record = db_fetch_object($result))){
- db_query("INSERT INTO {freeway} (node_id, file_id,project_id,src_lang, tar_lang, node_title, node_body) VALUES ('$nodeID','$fileIdbtained','$pidobtained','$src_Lang','$first','$node_title','$node_body')");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement