<?   $record=0;   $db=@mysql_pconnect('localhost','root');   @mysql_select_db('1234',$db);   $strsql="select * from 1234_data";   $result=@mysql_query($strsql);   $data=@mysql_fetch_array($result);   $record=@mysql_num_rows($result);
  echo "<select name=type size=1>\n";        do{              if ($record==1){                 echo "<option value=".$data['cname']." selected>".$data['cname']."</option>\n";                           }              else{                 echo "<option value=".$data['cname'].">".$data'cname']."</option>\n";              }        }while($data=@mysql_fetch_array($result));        echo "</select>\n"; ?>

源文:http://www.phpchina.com/index.php?action-viewnews-itemid-11017



© 活着的博客 - 李权辉的个人博客:人,终究是生活在现实之中,是为了活着而生活.