<?php
include 'connect61.php';
	$text = $_REQUEST['ms'];
	if(stripos($text,'**')!== false){
		$query=$dbh->prepare("SELECT * from [GroupReport].[dbo].[ipv] where  b_id like '%".substr($text,2)."%' or b_name like '%".substr($text,2)."%'");
		$query->execute();
		if($query->rowCount()!=0){
			$row=$query->fetch();
			echo $row['b_id'].' '.$row['b_name'].PHP_EOL.$row['b_ipv'].PHP_EOL.$row['b_cloud'].PHP_EOL.$row['b_tell'];
		}
	}else{
		$query=$dbh->prepare("SELECT * from [GroupReport].[dbo].[tbArkAndAnswer] where Ark='$text'");
		$query->execute();			
		if($query->rowCount()!=0){
			$ms=$query->fetch();
			echo $ms['Answer'];
		}
	}
?>