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


边栏推荐
- Constraintlayout's constraintset dynamically modifies constraints
- Unity Editor Extension - Outline
- Unity editor expansion - draw lines
- 二进制转十进制,十进制转二进制
- JS non Boolean operation - learning notes
- 注解简化配置与启动时加载
- Cesium for unreal quick start - simple scenario configuration
- Find the intersection of line segments
- URL backup 1
- Collection interface
猜你喜欢

梯度下降法求解BP神经网络的简单Demo

Collection interface

Animation_ IK overview

UE4 source code reading_ Bone model and animation system_ Animation node

Es8 async and await learning notes

MySQL 8

Concurrent programming (V) detailed explanation of atomic and unsafe magic classes

Life cycle of Servlet

Visual Studio (VS) shortcut keys

Monotonic stack -503 Next bigger Element II
随机推荐
Unity Editor Extension - Outline
[rust notes] 05 error handling
Unity editor expansion - the framework and context of unity imgui
[rust notes] 07 structure
第一个Servlet
Redux - learning notes
【Rust 笔记】10-操作符重载
Unity notes 1
Unity editor expansion - controls, layouts
Kwai 20200412 recruitment
Unity editor expansion - window, sub window, menu, right-click menu (context menu)
LinkedList set
MySQL three logs
matlab神經網絡所有傳遞函數(激活函數)公式詳解
Markdown learning
22-06-28 Xi'an redis (02) persistence mechanism, entry, transaction control, master-slave replication mechanism
Unity4.3.1 engine source code compilation process
Unity editor expansion - scrolling list
UE4 source code reading_ Bone model and animation system_ Animation compression
Kunlunbase meetup is waiting for you!