如题所述
"æç´¢"åæsubmit, å°åé¢çè¾å ¥å¦å·,æåname="sid"æ交çåå°ç sqlSear.php(èªå·±ååå), ç¨forméçactionå§. -- sqlSearch.phpé使ç¨mysqli( "select * from youtable where id=".$_GET['sid']) æ¥; ååºæ°æ®ç¨<?php echo****['**'];?>è¾åºå°ä¸é¢çinputåé¢å°±è¡, åæ£ææ¯è¿ä¹åç.å¦
<label>å¦å·</label><input > <?php echo $result['id'];?>追é®è°¢è°¢
åé¢çæ¥æ¾åè½æä¼ï¼å°±æ¯ä¸ç¥éæä¹è®©å¯¹åºçæ°æ®æ¾ç¤ºå¨å¯¹åºçä½ç½®
å¨åå§ç页é¢ä¸æ¾ç¤ºï¼ä¸æ¯ç´æ¥å¨phpè¯å¥éè¾åº
追çstatic html<input name="sid" placeholder="input search id">
<input type="submit" value="Search">
php file
<?php
$conn = mysqli_connect("localhost","yourroot","yourrootpwd","yourdatabase");
$result = mysqli_query( "select * from yourdatabase where id=".$_GET['sid'],$conn);
$row = mysqli_fetch_row( $result);
$id = $row['id'];
$name = $row['name'];
.......
$sex = $row['sex'];
...........
?>
<label> id </label> <?php echo $id;?>
<label> name </label> <?php echo $name;?>
....
<input type="radio" checked="<?php if( $sex='man') echo 'checked'; else echo '';?>">
.........
温馨提示:答案为网友推荐,仅供参考
第1个回答 2016-12-20
完全不知道你这是要做什么。。。怎么给代码提示?追问
点击搜索使数据库内容显示在对应的位置