第一个JS问题
<input id="bid" value="5000">
<input id="reserve_price" value="750.00">
<script>
$$=function(id){
return document.getElementById(id);
}
var error='';
if($$("bid").value.replace(/^\s+/,"").replace(/\s+$/,"")<$$("reserve_price").value){
error+="Your bid must be equal to or higher than the reserve price\n";
}
alert($$("bid").value.replace(/^\s+/,"").replace(/\s+$/,""));
alert($$("reserve_price").value);
alert(error);
</script>
你们认为这写法对吗?认为对的请运行程序看看,娃哈哈。。
第二个数据库问题。
数据表名称product
id int(4)
name varchar(20);
price text
有2条记录
id name price
1 电视机 750.00
2 空调 5000
按价格高低排序出来
写sql语句
select * from product order by price desc
认为对的请运行看看,
------解决方案--------------------
一直很关注楼主。
------解决方案--------------------
首先,我不会把价格字段用text存储,因此不会有这个错误。