当前位置:网站首页>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
边栏推荐
- php-fpm软件的安装+openresty高速缓存搭建
- 单调栈-42. 接雨水
- Cloudcompare learning (1) - cloudcompare compilation and common plug-in implementation
- [concurrent programming] synchronization container, concurrent container, blocking queue, double ended queue and work secret
- Installation of PHP FPM software +openresty cache construction
- 使用base64编码传图片
- First Servlet
- [redis] redis persistent RDB vs AOF (source code)
- Creation and content of mapnode -- osgearth rendering engine series (2)
- JS non Boolean operation - learning notes
猜你喜欢
Explain sizeof, strlen, pointer, array and other combination questions in detail
Kwai 20200412 recruitment
二进制转十进制,十进制转二进制
22-06-28 西安 redis(02) 持久化机制、入门使用、事务控制、主从复制机制
数据库原理期末复习
UE4 source code reading_ Mobile synchronization
Image processing 8-cnn image classification
了解小程序的笔记 2022/7/3
Dealing with duplicate data in Excel with xlwings
Log4j2 vulnerability recurrence and analysis
随机推荐
22-06-27 Xian redis (01) commands for installing five common data types: redis and redis
100 GIS practical application cases (78) - Multi compliance database design and data warehousing
【Rust笔记】05-错误处理
Deep parsing (picture and text) JVM garbage collector (II)
producer consumer problem
Unity editor expansion - controls, layouts
[redis] redis persistent RDB vs AOF (source code)
[cloud native] introduction and use of feign of microservices
Gradle's method of dynamically modifying APK package name
Osgearth topographic shading map drawing
MySQL three logs
Cesium service deployment, and import and display local 3dfiles data
22-05-26 西安 面试题(01)准备
Message pack in C deserializes array objects
Monotonic stack -42 Connect rainwater
Explain sizeof, strlen, pointer, array and other combination questions in detail
VIM learning notes from introduction to silk skating
Jupyter remote server configuration and server startup
[rust notes] 12 closure
Pit & ADB wireless debugging of vivo real machine debugging