<?
if ($_POST[tabienno] != "" and $_POST[tabienno2] == "")
{
$sql_con = "where tabienno LIKE '%$_POST[tabienno]%'";
}else if ($_POST[tabienno] == "" and $_POST[tabienno2] != "")
{
$sql_con = "where tabienno2 LIKE '%$_POST[tabienno2]%'";
}else if ($_POST[tabienno] != "" and $_POST[tabienno2] != "")
{
$sql_con = "where tabienno LIKE '%$_POST[tabienno]%' and tabienno2 LIKE '%$_POST[tabienno2]%'";
}
?>
$lentb1=strlen($tabien1);
$lentb2=strlen($tabien2);
if( $lentb1 && $lentb2){
$sql =" select * from tb where tabienno like '%".$tabien1."%' and tabienno2 like '%".$tabienno2."%' ";
}elseif($lentb1){
$sql =" select * from tb where tabienno like '%".$tabien1."%' ";
}else{
$sql =" select * from tb where tabienno2 like '%".$tabienno2."%' ";
}