当前位置:网站首页>SQL statement error of common bug caused by Excel cell content that is not paid attention to for a long time
SQL statement error of common bug caused by Excel cell content that is not paid attention to for a long time
2022-07-03 08:46:00 【The luckier~】
bug------ Strange index value generation ( Solution :addslashes)
Preface :bug------ Strange index value generation ( Solution :addslashes)
When the code is running BUG
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 ‘04643945’’ at line 1
error SQL:select * from book where 1=1 and book_id=’‘04643945’
Here are some Inline code slice .
// Display the error code
$result = 'select * from book where 1=1 and book_id=\'' .$datahtml[$i]['nuid'] .'\'';
// Show corrections
$result = 'select * from book where 1=1 and book_id=\'' .addslashes($datahtml[$i]['nuid']) .'\'';
From the above code, we can see that we have added one more PHP function :
The action point of the function can be linked .(https://www.w3school.com.cn/php/func_string_addslashes.asp)
addslashes() Function returns a string with a backslash before a predefined character .
The reason for the error :’‘04643945’
Cause of error : When EXCEL When the number in is text , When importing or copying select all , With single quotation marks on it


边栏推荐
- matlab神經網絡所有傳遞函數(激活函數)公式詳解
- Monotonic stack -503 Next bigger Element II
- [K & R] Chinese Second Edition personal questions Chapter1
- 请求参数的发送和接收
- Servlet的生命周期
- Kunlunbase meetup is waiting for you!
- Mysql容器化(1)Docker安装MySQL
- Concurrent programming (VI) ABA problems and solutions under CAS
- Redis cluster series 4
- Vscode, idea, VIM development tool shortcut keys
猜你喜欢
![[updating] wechat applet learning notes_ three](/img/05/958b8d62d3a42b38ca1a2d8631a7f8.png)
[updating] wechat applet learning notes_ three

22-06-27 西安 redis(01) 安装redis、redis5种常见数据类型的命令

Constraintlayout's constraintset dynamically modifies constraints
![[RPC] RPC remote procedure call](/img/dc/872204ea47fcff04cdb72e18a2a4ef.jpg)
[RPC] RPC remote procedure call

Notes on understanding applets 2022/7/3

UE4 source code reading_ Mobile synchronization

Solution détaillée de toutes les formules de fonction de transfert (fonction d'activation) du réseau neuronal MATLAB

First Servlet

Explain sizeof, strlen, pointer, array and other combination questions in detail

Visual Studio (VS) shortcut keys
随机推荐
Markdown learning
[concurrent programming] thread foundation and sharing between threads
LinkedList set
[cloud native] introduction and use of feign of microservices
[rust notes] 11 practical features
MySQL containerization (1) docker installation MySQL
Constraintlayout's constraintset dynamically modifies constraints
matlab神經網絡所有傳遞函數(激活函數)公式詳解
Animation_ IK overview
Pit & ADB wireless debugging of vivo real machine debugging
【Rust 笔记】10-操作符重载
[concurrent programming] explicit lock and AQS
How to deal with the core task delay caused by insufficient data warehouse resources
100 GIS practical application cases (78) - Multi compliance database design and data warehousing
[concurrent programming] synchronization container, concurrent container, blocking queue, double ended queue and work secret
Osgearth north arrow display
[concurrent programming] concurrent security
Ue5 opencv plug-in use
Creation and content of mapnode -- osgearth rendering engine series (2)
Dealing with duplicate data in Excel with xlwings