<?php 

include("session_start.php");

include("session_check.php");

include("database.php");

if($_GET['q']!="")

{	

	$q=$_GET["q"];

	//echo $q;

	$sql="SELECT * FROM tree_name WHERE tid= '$q'  ";

	//echo "SELECT * FROM tree_name WHERE tid= '$q'  ";

	$rest=mysql_query($sql);

	

	while($row=mysql_fetch_array($rest))

	{

	 $query_master_sci = mysql_query("select * from tree_name");

	 while($row_master_sci = mysql_fetch_array($query_master_sci))

	 {

		 if($row['tid'] == $row_master_sci['tid'])

         {

 			?>

	<option value="<?php print $row['tid'];?>" selected><?php print $row['scientific_name'];?> </option>

     <?php 	}

   		else 

  		 {

  ?>

  <option value="<?php print $row_master_sci['tid'];?>" ><?php print $row_master_sci['scientific_name'];?> </option>

  <?php

      	}

    	} 

	 }

}



	

?>

