为什么option取出的是数字?

我想让他插入到数据库是显示中文!
而不是显示数字1!
因该怎么改
图片描述

图片描述


<?php $sql = "select * from bigtype"; $result = mysql_query( $sql ); ?> <select style="width:200px;" name="bigtype[]" id="bigtype" onchange="changelocation(document.myform.bigtype.options[document.myform.bigtype.selectedIndex].value)" size="1"> <option>请选择套餐</option> <?php while($rows=mysql_fetch_array($result)){?> <option value="<?php echo $rows['id']; ?>"><?php echo $rows['bigtype']; ?></option> <?php } ?> </select> <select style="width:100px;" class="trololo" name="smalltype[]" id="smalltype"> <option>请选择小类</option> </select> 单价:<input style="display:inline-block;width:100px;" type="text" class="form-control" id="price_1" name="price[]" onchange="changecoat(1)" > 数量:<input style="display:inline-block;width:100px;" type="text" class="form-control" id="count_1" name="quantity[]" onchange="changePrice(1)"> 计价:<input style="display:inline-block; width:100px;" type="text" class="form-control" id="total_1" name="valuation[]" readonly="readonly" > <br/>
阅读 3k
1 个回答

1、你想要插入数据到到数据库,但是php执行的是select操作
2、如果optionvalue属性,则提交的是value值,没有则选项的值将设置为 <option> 标签中的内容。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题