社区
基础编程
帖子详情
大家好,我在设计购物车是时,有一个清空购物车,我的思路是清空car这个数据库,但不知怎么写这个sql语句
110199
2003-10-17 03:11:36
大家好,我在设计购物车是时,有一个清空购物车,我的思路是清空car这个数据库,但不知怎么写这个sql语句(平时只是在mysql 中操作过这个选项),请指教!
...全文
109
1
打赏
收藏
大家好,我在设计购物车是时,有一个清空购物车,我的思路是清空car这个数据库,但不知怎么写这个sql语句
大家好,我在设计购物车是时,有一个清空购物车,我的思路是清空car这个数据库,但不知怎么写这个sql语句(平时只是在mysql 中操作过这个选项),请指教!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
ayjg
2003-10-18
打赏
举报
回复
......
conn.Execute("Delete from car where ID="&Num)
Num为购物车编号(如果没用的话,去掉where语句)
详细
购物车
实现代码html+js
看文章理解
购物车
的实现流程,可以
清空
ca
r.js文件自己练习
html
购物车
页面
今天博主给大家分享
一个
自己做的
购物车
页面,使用的是html+css实现: 话不多说,直接上图: 这个页面只是实现了其布局视图,没有使用js或者jquery相关语言,在博主看来是比较利于我们将其加入到自己的程序中的 以下是相关代码: index.html 商品名称 单价 数量 操作 旁氏洗发露 99 1 删除 旁氏洗发露 99 1 删除 小计: 总数: 确认购买 全部
清空
ca
r.css body{ overflow: hidden; text-align: center; } .
ca
r{ width:60%; bord
网上图书销售
数据库
+ASP
<% BookIDList = Session("BookIDList")'session(BookIDList)第一次运行为空 ABookID = Split(Request("bookID"), ", ")'ABookID数组存入的是图书的id' For I=0 To UBound(ABookID)'显示数组的最大维数 If Len(BookIDList) = 0 Then BookIDList = "'" & request("bookID") & "'" ElseIf InStr( BookIDList, request("bookID")) 您的
购物车
为空! 您还没有选购任何书籍,您的
购物车
为空! <% if request.Form("jiezhang")="保存订单" then response.Redirect("checkout.asp") end if If Len(Session("BookIDList")) 0 Then sql = "Select * From tb_book Where isbn In (" &_ session("bookIDList") & ") Order By isbn" Set rs = cnn.Execute( sql ) else Response.Redirect "buy
ca
rempty.asp" end if %> 查看
购物车
function stand(){ window.close();} 书号 书 名 单价 数量 金额 移去 <% sl = Request( "sl"&i) If sl
(元)
(元)
合计金额:
(元)
清空
购物车
<% session("mName")="" if request.Form("UserID")"" and request.Form("userPWD")"" then session("ID1")=request.Form("UserID") session("PWD")=request.Form("userPWD") set rs=Server.CreateObject("ADODB.RecordSet") sql="SELECT userid, password FROM tb_member WHERE userid='" & session("ID1")&"'" set rs=cnn.execute(sql) if rs.eof then %> alert("登录失败!"); window.history.back(); window.lo
ca
tion.href="checkoutok.asp" alert("您输入的会员密码错误,请重新输入!"); history.back(); 保存订单信息 //检验会员ID号和密码 function check(){ if (form1.userID.value==""){ alert("请输入会员ID号!");form1.userID.focus();return;} if (form1.userPWD.value==""){ alert("请输入会员密码!");form1.userPWD.focus();return;} form1.submit();} 如果您还不是我们的会员,请单击“注册”按钮注册会员! 会员ID号: 注册 您的密码: 以下是您选购的图书: 书号 书名 单价 数量 金额 (元) (元) 订单保存成功! <% '返回订单号等信息 orderid=objCmd.Parameters(3) sql1 = "Select * From tb_book Where isbn In (" & session("checkBook") & ")" Set rs = cnn.Execute( sql1 ) ASL1="" ASL1=split(session("sl"),",") i=0 sum=0 shuliang=0 while not rs.eof bookID=rs("isbn") price=rs("price") paSL=cInt(ASL(i)) booksum=cdbl(rs("price"))*ASL(i) sql2="insert into tb_orderdetail(orderid,isbn,num,money) values ('"&_ orderid&"','"&bookID&"',"&paSL&","&booksum&")" set rs1=cnn.execute(sql2) i=i+1 rs.movenext wend for each parm in objCmd.Parameters if parm.name="parID" then name1="会员ID" end if if parm.name="sum" then name1="订货金额" end if if parm.name="oDate" then name1="订购日期" end if if parm.name="aa" then name1="订单号" end if Response.Write name1 &":"& trim(parm) if name1="订货金额" then response.write "元" else response.write "" end if next %> 订单已经成功保存,欢迎下次惠顾! 网上图书订购 AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/
ca
bs/flash/swflash.
ca
b#version=9,0,28,0','width','639','height','119','src','../images/banner','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../images/banner' ); //end AC code 网站首页 查看
购物车
会员登录 管理员登录 书号 书名 出版社 图书类型 作者 等于 Like 查询图书库存量 书号 书名 图书类型 等于 Like <% If (Request("cValue") "" and Request("sField") "") Then If (Request("cValue") "") Then session("INvalue") = Request("cValue") End If session("pBookName") = "BookName" If (Request("sField") "") Then session("pBookName") = Request("sField") End If session("pBookName")=Replace(session("pBookName"), "'", "''") session("INvalue")=Replace(session("INvalue"), "'", "''") If (Request("mode") "") Then session("rs_mode") = Request("mode") End If end if if session("rs_mode")"" then if session("rs_mode")="==" then sql= "SELECT isbn, bookname, kind, price,total FROM tb_total WHERE "_ + session("pBookName") + " = '" + session("INvalue") + "'" else sql = "SELECT isbn, bookname, kind, price,total FROM tb_total WHERE "&_ session("pBookName") & " Like '%" & session("INvalue") & "%'" end if else sql="SELECT isbn, bookname, kind, price,total FROM tb_total " end if set rs_search=Server.CreateObject("ADODB.RecordSet") rs_search.open sql,cnn,1,3 %> function newwin1(url){ var newwin=window.open(url,"","resizable=yes,scrollbars=yes,width=700,height=400"); newwin.focus(); return false; } 书号 书 名 图书类型 价格 库存 alert("无符合条件的图书!") history.back(1) <%response.end() end if '分页' rs_search.pagesize=7 page=CLng(Request("page")) if page <% if page1 then %>
第一页
上一页 <%end if if pagers_search.pagecount then %>
下一页
最后一页 无符合条件的记录! <% response.Expires=-1 username1=trim(request("username")) userpass1=trim(request("userpass")) if username1="" or userpass1="" then session("passed1")="" session("msg1")="用户ID和密码不能为空" else set rs=server.CreateObject("adodb.recordset") strsql="select * from tb_member where userid='"&username1&"'" rs.open strsql,cnn,3,3 if rs.eof then session("passed1")="" session("msg1")="用户ID不存在" else if rs("PassWord")userpass1 then session("passed1")="" session("msg1")="密码错误" else session("passed1")=true session("msg1")="" session("ID1")=username1 session("username1")=rs("UserName") end if end if end if response.Redirect("memberlogin.asp") %> 会员登录 function chkfields(){ if(document.myform.username.value==''){ alert("用户ID不能为空"); document.myform.username.focus(); return false; } if(document.myform.userpass.value==''){ alert("用户密码不能为空"); document.myform.userpass.focus(); return false; } return true; } function look(id){ window.open("orderhistory.asp?ID="+id,"","scrollbars=yes,resizable=yes,width=700,height=600"); } AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/
ca
bs/flash/swflash.
ca
b#version=9,0,28,0','width','639','height','119','src','../images/banner','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../images/banner' ); //end AC code 网站首页 查看
购物车
会员登录 管理员登录 <% if session("msg1")"" then response.write session("msg1") else response.write "用户登录" end if %> I D: 密 码: 用户 , 您已成功登录
会员注册成功 祝贺您,已经注册成功! 您的会员ID号为:[ ] 密码为: [ ] 请记好! 单击“返回”按钮保存订单信息。
carempty.asp") Else session("BookIDList")= BookIDList Response.Redirect "buy
ca
rsee.asp" end if %> <% response.Expires=-1 username1=trim(request("username")) userpass1=trim(request("userpass")) 'response.write 41 'response.End() if username1="" or userpass1="" then session("passed")="" session("msg")="请您先登录再进来!" 'response.Redirect("userlogin.asp") else set rs=server.CreateObject("adodb.recordset") strsql="select * from tb_operator where operatorname='"&username1&"'" rs.open strsql,cnn,3,3 if rs.eof then session("passed")="" session("msg")="管理员名称不存在" else if rs("password")userpass1 then session("passed")="" session("msg")="密码错误" else session("passed")=true session("msg")="" session("username")=rs("operatorname") 'response.Redirect("userlogin.asp") end if end if end if response.Redirect("operatorlogin.asp") %> 管理员登录 function chkfields(){ if(document.myform.username.value==''){ alert("管理员名称不能为空"); document.myform.username.focus(); return false; } if(document.myform.userpass.value==''){ alert("管理员密码不能为空"); document.myform.userpass.focus(); return false; } return true; } function take(){ window.open("lookup.asp","图书库存查询"); } AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/
ca
bs/flash/swflash.
ca
b#version=9,0,28,0','width','639','height','119','src','../images/banner','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../images/banner' ); //end AC code 网站首页 查看
购物车
会员登录 管理员登录 <% if session("msg")"" then response.write session("msg") else response.write "管理员登录" end if %> 管理员: 密码: 管理员 , 登录成功 的订单一览表 的订单一览表 订单号书号书名价格数量金额购书日期 <% rs.pagesize=7 page=CLng(Request("page")) if page 第一页 <% end if if page1 then %> 第一页
上一页 <%end if if pagers.pagecount then %>
下一页
最后一页 <% else response.write "您没有购书记录!" end if %> <% If (Request("cValue") "" and Request("sField") "") Then If (Request("cValue") "") Then session("INvalue") = Request("cValue") End If session("pBookName") = "BookName" If (Request("sField") "") Then session("pBookName") = Request("sField") End If session("pBookName")=Replace(session("pBookName"), "'", "''") session("INvalue")=Replace(session("INvalue"), "'", "''") If (Request("mode") "") Then session("rs_mode") = Request("mode") End If end if if session("rs_mode")"" then if session("rs_mode")="==" then sql= "SELECT isbn, bookname, author, price FROM tb_book WHERE "_ + session("pBookName") + " = '" + session("INvalue") + "'" else sql = "SELECT isbn, bookname, author, price FROM tb_book WHERE "&_ session("pBookName") & " Like '%" & session("INvalue") & "%'" end if else sql="SELECT isbn, bookname, author, price FROM tb_book " end if set rs_search=Server.CreateObject("ADODB.RecordSet") rs_search.open sql,cnn,1,3 %> function newwin1(url){ var newwin=window.open(url,"","resizable=yes,scrollbars=yes,width=700,height=400"); newwin.focus(); return false; } 书号 书 名 作 者 原价 现 价 购物 alert("无符合条件的图书!") history.back(1) <%response.end() end if '分页' rs_search.pagesize=7 page=CLng(Request("page")) if page
<% if page1 then %>
第一页
上一页 <%end if if pagers_search.pagecount then %>
下一页
最后一页 无符合条件的记录!
购物车
的
清空
、删除、数量变化
表有汇PC端
购物车
清空
、删除、修改功能实现
清空
实际上就是将该用户的所有
购物车
数据的有效否改成false,从而不让商品显示出来;数量变化就是修改。
购物车
页面: 对应的html代码:
清空
购物车
我的
购物车
Shopping
Ca
rt 1放进
购物车
2填
写
订
JavaWeb
购物车
项目(二)
今天主要接着
购物车
项目优化,主要是把
购物车
没有完善的地方给完善。 目录
购物车
完善
思路
1.商品数量的加减 2.商品删除 3.
清空
购物车
所有商品
购物车
完善
思路
1.商品数量的加减 当点击+号数量增加,点击-号数量减少 当点击+或者-跳转到操作数量加减的页面,进行数据的修改 点击+或者-携带
一个
商品id过去,然后如果是加携带
一个
1过去,减携带
一个
2过去。(可以是任意数字,为了在数据操作界面接收到传来的值判断是数量增加,还是减数量进) 放置数量的地方是
一个
输入框,在里面也可以输入数
基础编程
21,881
社区成员
140,365
社区内容
发帖
与我相关
我的任务
基础编程
从PHP安装配置,PHP入门,PHP基础到PHP应用
复制链接
扫一扫
分享
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章