The command mysql_query using way is right?
$str="select t1.col1,t1.col2,t1.col3,t2.col2,t2.col4 from train_time t1,train_time t2 where t1.name='$name1' and t2.name='$name2' and t1.number=t2.number";
mysql_query($str,$id);