当前位置:网站首页>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


边栏推荐
- Deep parsing (picture and text) JVM garbage collector (II)
- 22-05-26 西安 面试题(01)准备
- [concurrent programming] Table hopping and blocking queue
- Message queue for interprocess communication
- OpenGL learning notes
- Creation of osgearth earth files to the earth ------ osgearth rendering engine series (1)
- How does unity fixedupdate call at a fixed frame rate
- 22-06-28 Xi'an redis (02) persistence mechanism, entry, transaction control, master-slave replication mechanism
- [concurrent programming] consistency hash
- Analysis of Alibaba canal principle
猜你喜欢

php-fpm软件的安装+openresty高速缓存搭建

Analysis of Alibaba canal principle

单调栈-84. 柱状图中最大的矩形

Installation of PHP FPM software +openresty cache construction

了解小程序的笔记 2022/7/3

UE4 source code reading_ Mobile synchronization

Unity interactive water ripple post-treatment

Monotonic stack -42 Connect rainwater
![[redis] redis persistent RDB vs AOF (source code)](/img/57/b6a86c49cedee31fc00dc5d1372023.jpg)
[redis] redis persistent RDB vs AOF (source code)
![P1596 [USACO10OCT]Lake Counting S](/img/a7/07a84c93ee476788d9443c0add808b.png)
P1596 [USACO10OCT]Lake Counting S
随机推荐
Gradle's method of dynamically modifying APK package name
[concurrent programming] synchronization container, concurrent container, blocking queue, double ended queue and work secret
Message queue for interprocess communication
单调栈-84. 柱状图中最大的矩形
【Rust 笔记】08-枚举与模式
Unity multi open script
Binary to decimal, decimal to binary
Image processing 8-cnn image classification
MySQL containerization (1) docker installation MySQL
matlab神經網絡所有傳遞函數(激活函數)公式詳解
Jupyter remote server configuration and server startup
Osgconv tool usage
Kwai 20200412 recruitment
UE4 source code reading_ Bone model and animation system_ Animation node
Talking about: is the HashSet set ordered or disordered /hashset set unique, why can we store elements with the same content
22-05-26 西安 面试题(01)准备
22-06-27 西安 redis(01) 安装redis、redis5种常见数据类型的命令
Life cycle of Servlet
Creation and content of mapnode -- osgearth rendering engine series (2)
Unity editor expansion - scrolling list