<?php
$id = $_GET['id'];
$con = mysql_connect("localhost","","");
if(!$con){
die("Could not connect " . mysql_error());
}
mysql_select_db("test",$con);
$result = mysql_query("SELECT * FROM exercise WHERE ID = '$id' ");
$row = mysql_fetch_array($result);
$firstname = $row['FirstName'];
$lastname = $row['LastName'];
$age = $row['Age'] - 17;
$link = $row['Link'];
?>
<html>
<body>
<form action = "2.php" method = "post">
FirstName <input type = "text" name = "firstname" value = "<?php echo $firstname ?>"/> <br/>
LastName <input type = "text" name = "lastname" value = "<?php echo $lastname ?>"/> <br/>
<label>Age</label>
<select name = "age" id = "age">
<option value = "17">17</option>
<option value = "18">18</option>
<option value = "19">19</option>
<option value = "20">20</option>
<option value = "21">21</option>
<script type="text/javascript">document.getElementById("age")['<?php echo $age ?>'] = true;</script>
</select>
<input type = "submit" value = "update"/>
<input type = "file" name = "file" id = "file"/>
<input type = "hidden" value = "update" name = "selection"/>
<input type = "hidden" value = "<?php echo $id?> " name = "id1"/>
<img src = "<?php echo $row['Link']?>"/>
</form>
</body>
</html>
MySQL and PHP 3
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- Mac下利用HomeBrew安装PHP开发环境,下面这篇文章写的很详细: INSTALL NGINX, PHP A...
- 由于公司php环境升级 之前公司一使用织梦dede二次开发的网站趴窝了 。报错DedeCMS错误DedeCMS E...
- 运行镜像 本镜像包含一个可以运行的webserver。含centos 7.3 php-7.1.4 nginx-1....