include("data.php");
session_start();
$link = mysql_connect("$ipadd", "$cn2us", "$cn2pd");
mysql_select_db("$cn2db", $link);
//select detail from root_table
$strsql = "select * from root_table order by root_id";
$result = mysql_query($strsql, $link);
while ($row3 = mysql_fetch_array($result)){
$nou[$row3[root_id]] = "$row3[root_name]";
}
//
$link = mysql_connect("$ipadd", "$cn2us", "$cn2pd");
mysql_select_db("$cn2db", $link);
$product_result = mysql_query("select * from products where id = $id");
$product_row = mysql_fetch_array($product_result);
switch($level){
case "1":
$strsql = "select * from upper_root_table where uroot_id = $product_row[uroot]";
@$rr1 = mysql_query($strsql);
@$rr1v = mysql_fetch_array($rr1);
break;
case "2":
$strsql = "select * from root_table where root_id = $product_row[root]";
@$rr2 = mysql_query($strsql);
@$rr2v = mysql_fetch_array($rr2);
$strsql = "select * from upper_root_table where uroot_id = $rr2v[root_info]";
@$rr1 = mysql_query($strsql);
@$rr1v = mysql_fetch_array($rr1);
break;
case "3":
$strsql = "select * from line where id = $line_id";
//echo "strsql : " . $strsql . "
";
@$rr3 = mysql_query($strsql);
@$rr3v = mysql_fetch_array($rr3);
$strsql = "select * from root_table where root_id = $rr3v[info]";
//echo "strsql : " . $strsql . "
";
@$rr2 = mysql_query($strsql);
@$rr2v = mysql_fetch_array($rr2);
$strsql = "select * from upper_root_table where uroot_id = $rr2v[root_info]";
//echo "strsql : " . $strsql . "
";
@$rr1 = mysql_query($strsql);
break;
}
?>