search

mysql问题
$sqlreturn = "update borrow_b set state = 1 where bid = ".$min_bid[0]." and license_id = ".$_SESSION['b_r_user']." and book_no = \"$book_no\";insert into return_b values(\"\",".$_SESSION['b_r_user'].", \"$book_no\",".$_SESSION['login_id'].", now());update book set stock = stock+1 where book_no = \"".$book_no."\";";
$q1 = mysql_query($sqlreturn, $conn);

每个语句我在phpadmin中都试过,都可以,放在一起query为什么不行??

出错信息是:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert into return_b values("",1827463521, "14353221",0, now()); update ' at line 2

求助!!

------解决方案--------------------
1、"update borrow_b set state = 1 where bid = ".$min_bid[0]." and license_id = ".$_SESSION['b_r_user']." and book_no = \"$book_no\";
2、insert into return_b values(\"\",".$_SESSION['b_r_user'].", \"$book_no\",".$_SESSION['login_id'].", now());
3、update book set stock = stock+1 where book_no = \"".$book_no."\";";

你这是 3 条指令呀!
mysql_query 只允许执行一条!

phpmyadmin 中可以,是他拆成3条执行的
------解决方案--------------------
。。只能一条一条的执行。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
SpringBoot Session怎么设置会话超时SpringBoot Session怎么设置会话超时May 15, 2023 pm 02:37 PM

问题发现springboot项目生产session-out超时问题,描述下问题:在测试环境通过改动application.yaml配置session-out,经过设置不同时间验证session-out配置生效,于是就直接设置了过期时间为8小时发布到了生产环境。然而中午接到客户反应项目过期时间设置较短,半小时不操作就会话过期需要反复登陆。解决处理开发环境:springboot项目内置Tomcat,所以项目中application.yaml配置session-out是生效的。生产环境:生产环境发布是

php session刷新后没有了怎么办php session刷新后没有了怎么办Jan 18, 2023 pm 01:39 PM

php session刷新后没有了的解决办法:1、通过“session_start();”开启session;2、把所有的公共配置写在一个php文件内;3、变量名不能和数组下标相同;4、在phpinfo里面查看session数据的存储路径,并查看该文件目录下的sessio是否保存成功即可。

session php默认失效时间是多少session php默认失效时间是多少Nov 01, 2022 am 09:14 AM

session php默认失效时间是1440秒,也就是24分钟,表示客户端超过24分钟没有刷新,当前session就会失效;如果用户关闭了浏览器,会话就会结束,Session就不存在了。

PHP如何在多个文件中正确地读取和写入Session数据PHP如何在多个文件中正确地读取和写入Session数据Mar 23, 2023 am 11:12 AM

当您在使用PHP会话(Session)时,有时会发现Session在一个文件中可以正常读取,但在另一个文件中却无法读取。这可能会让您感到困惑,因为会话数据应该可以在整个应用程序中共享。本文将解释如何在多个文件中正确地读取和写入PHP会话数据。

Redis的共享session应用如何实现短信登录Redis的共享session应用如何实现短信登录Jun 03, 2023 pm 03:11 PM

1.基于session实现短信登录1.1短信登录流程图1.2实现发送短信验证码前端请求说明:说明请求方式POST请求路径/user/code请求参数phone(电话号码)返回值无后端接口实现:@Slf4j@ServicepublicclassUserServiceImplextendsServiceImplimplementsIUserService{@OverridepublicResultsendCode(Stringphone,HttpSessionsession){//1.校验手机号if

Springboot2 session设置超时时间无效怎么解决Springboot2 session设置超时时间无效怎么解决May 22, 2023 pm 01:49 PM

问题:今天项目中遇到了一个设置时间超时的问题,按SpringBoot2的application.properties更改一直不生效。解决方案:server.*属性用于控制SpringBoot使用的嵌入式容器。SpringBoot将使用ServletWebServerFactory实例之一创建servlet容器的实例。这些类使用server.*属性来配置受控的servlet容器(tomcat,jetty等)。当应用程序作为war文件部署到Tomcat实例时,server.*属性不适用。它们不适用,

PHP如何处理微信小程序中的session问题PHP如何处理微信小程序中的session问题Jun 02, 2023 pm 03:40 PM

近年来,微信小程序风靡全球,已经成为了许多企业和个人开发者的首选平台。在小程序的开发中,我们经常会遇到session问题,也就是如何在小程序中保存用户登录状态。这个问题对于网站开发者来说并不陌生,但在小程序中却有些不同。本文将介绍如何使用PHP解决微信小程序中的session问题。一、小程序登录过程概述小程序的登录流程与网站的登录流程类似,分为以下几个步骤:

怎么修改ThinkPHP6中的Session配置怎么修改ThinkPHP6中的Session配置Jun 03, 2023 pm 06:58 PM

一、Session介绍在Web应用程序中,Session是一种保存在Web服务器上的数据结构,用于存储用户信息。当用户访问一个网站时,服务器就会创建一个Session,并将该Session的ID发送给客户端浏览器。浏览器在返回请求时,会带上该Session的ID,服务器就可以通过该ID找到该用户的Session,并从Session中读取或修改用户的信息。Session的作用主要可以归纳为以下几个方面:存储用户信息。比如用户的登录状态、购物车内容、表单数据等。实现跨页面数据共享

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor