: This article mainly introduces PHP's built-in function analysis to prevent SQL injection. if you are interested in the PHP Tutorial, please refer to it. SQL
Injection AttacksIt is the most common method for hackers to attack websites. If your site does not use strict user input check, it is often vulnerable to SQL
In
Use the Addslashes function in PHP to prevent SQL injection.Although many PHP programmers in the country still rely on addslashes to prevent SQL injection, it is recommended to strengthen Chinese to prevent SQL injection check.The problem with addslashes is that hackers can use 0xbf27 instead of single quotes, and adds
SQL Custom Function Split delimited stringF_split: Splitting a string into a data table Create FUNCTION [dbo]. [F_split] (@SplitString nvarchar (max),--source string @Separator nvarchar (10) = "--delimited symbol, default to space) RETURNS @SplitStringsTable table-Output datasheet ([id] int identity (), [value] nvarchar (max)) as BEGIN DECL is @CurrentIndex
Label:Previously wrote a merged string of the CLR aggregate function, basically is copied Ms example, plus some processing, has been put into use for a long time, no problem also did not how to study, recently wanted to change, encountered some problems, then tinkering with some experience, recorded as follows.I. Miscellaneous
CLR aggregation functions, although they are functions in SQL, are actually p
In this SQL statement, the function is a mysql function or a php function. the Function means mysql_query ( quot; UPDATE 'users' SET 'jifen' = round ('jifen' + ('percent '/100), 1) WHEREuser =' $ inuser' quot ;); the SQL
"51cto/bbs" ask: SQL has no string combination join function??Original address: http://bbs.51cto.com/thread-1133863-1.htmlProblem Description:VB has two very useful string processing functions:Split (string, delimiter) acts: Breaks the string by the delimiter as the boundary and decomposes the array. Returns: an array of strings.Join (character array, delimiter) acts: The element in the character array is c
Label:This function has none of deterministic, NO SQL solutionWhen you create a stored procedureError message:ERROR 1418 (HY000): This function has none of the deterministic, NO SQL, or READS SQL DATA in its declaration and binary Loggi NG is enabled (you *might* want to use
It is inconvenient to use SQL * Plus on Linux, that is, there is no historical callback function. Ldquo can be used for SQL * Plus on Windows; up to rdquo; Arrow
It is inconvenient to use SQL * Plus on Linux, that is, there is no historical callback function. Ldquo can be us
()
Returns the number of days between two dates
Date_format ()
Display Date/time in a different format
SQL Server Date functionThe following table lists the most important built-in date functions in SQL Server:
function
Description
GETDATE ()
Returns the current date and time
For the dbms_random described in the previous article. In the case of the value function, it is obvious that the call to the function occurred during the execution of the SQL statement. However, if you look at the processing of constants in SQL statements, you can see that for func
The function is very simple. It mainly processes input data of the string and number types separately. The specific usage is as follows:
Character TypeStrusername = checkinput (Request ("username"), "S")Numeric typeId = checkinput (Request ("ID"), "I")
Below is the function
Function checkinput (STR, strtype)'Function:
We used php or asp for data cutting. Today, we suddenly found that the Split function in SQL can also be used to cut strings in SQL queries. If you need it, please refer to it.
We used php or asp for data cutting. Today, we suddenly found that the Split function in SQL can a
Label:Convert a date format using the CONVERT function in SQL Server 2008-01-23 15:47
Convert date format with convert function in SQL Server 2008-01-15 convert date format with convert function in 15:51sqlserver The default date field for the Chinese ver
Tags: SQL Oracle server DB2 time functionSQL Server Time article: *************************************************************One, Time function--getdate Get current timeSelect GETDATE ()--dateadd Original time Add: 2013-02-17 13:20:16 this time plus 12 monthsSelect DATEADD (month,12, ' 2013-02-17 13:20:16 ')--return: 2014-02-17 13:20:16.000 (parameter MONTH can be changed to day,year etc. date plus corres
Document directory
(1) No parameter form
(2) Parameters
(1) No parameter form
(2) Parameters
(1) No parameter form
(2) Parameters
(1) No parameter form
(2) Parameters
(1) No parameter form
(2) Parameters
This article describes the use of the five Aggregate functions, namely Count, Sum, Min, Max, and Avg. These functions are used in the same scenario as SQL commands, are used for statistics, Count, sum, minimum, maximum, and average.1. Co
Tags: http image images Read modification technology MYSQ term solutionError message: [ERR] 1418-this function has none of deterministic, NO SQL, or READS SQL DATA in its declaration and binary loggin *might* want to use the less safe log_bin_trust_function_creators variable) Reason: This is when we open the bin-log, we must mean Determine if our
This article mainly introduces the SQL injection and escape code. In fact, you can refer to the dedecms Empire phpcms code during usage. I believe your code is safer for SQL injection:
Under normal circumstances:
Delete. php? Id = 3;$ SQL = 'delete from news where id = '. $ _ GET ['id'];
Malicious situation:
Delete. php? Id = 3 or 1;$
Specific usage
addslashes prevents SQL injection
Although many domestic PHP programmers are still relying on addslashes to prevent SQL injection, it is recommended that you strengthen the Chinese to prevent SQL injection inspection. The problem with addslashes is that hackers can use 0xbf27 instead of single quotes, and addslashes only modifies 0xbf27 to 0xbf5c
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.