This paper describes the simple implementation of SQL anti-injection method in PHP. Share to everyone for your reference, as follows:
There is not much filtering here, mainly for PHP and MySQL combination.
General anti-injection, as long as the use of PHP addslashes function is possible.
Here's a copy of the code:
PHP Code:
$_post = Sql_injection ($_post); $_get = Sql_injection ($_get); function Sql_injection ($content) {if (!get_magic_quotes_ GPC (
* from table name order by rand () limit nAccess left connection syntax (the left connection is used in recent development, access does not help anything, there is no access SQL instructions on the internet, only test by yourself, now write down for future check)Syntax elect table1.fd1, Table1, fd2, table2.fd2 from Table1 left join Table2 on table1.fd1, table2.fd1 where...Use SQL statements to display long
tablename where id not in (select max (id) from tablename group by col1, col2 ,...)
Lists All table names in the database.Select name from sysobjects where type = 'U'
Description: lists allSelect name from syscolumns where id = object_id ('tablename ')
Use SQL statements to display long strings...Syntax:SQL database: select case when len (field)> 10 then left (field, 10) + '...' else field end as news_name, news_id from tablenameAccess Datab
SQL Tune Report-sqltrpt. SQL, reportsqltrpt. SQL
ORACLE 10 Gb provides a script sqltrpt. SQL to query the most resource-consuming SQL statements. The output result is divided into two parts:
15 Most expensive SQL in the cursor cac
a view
DROP VIEW [dbo].[View name]
GO
---------------
--determine if the name of the function to be created exists
IF exists(SELECT * fromDbo.sysobjectsWHEREId= object_id(N'[dbo]. [function name]') andXtypeinch(N'FN'N'IF'N'TF'))
--Delete a function
DROP FUNCTION [dbo].[Name of function]
GO
IF col_length('Table name','Column Name') is NULL
PRINT 'does not exist'
SELECT 1 fromsysobjectsWHEREIdinch(SELECTId fromsyscolumnsWHEREName='Column Name') andName='Table name' Reprint: http://www.bitscn.c
T-SQL is an enhanced SQL language provided by SQLServer based on the SQL language. The T-SQL provides all the features of ANSISQL and adds more features such as extended functions, system pre-storage, and program design structures. The following describes
3. the T-SQL of
Look at the original stickers in detail: http://search.csdn.net/Expert/topic/1546/1546652.xml? Temp =. 8588983.
Note: copy a table (only copy structure, source table name: a new table name: B)SQL: select * into B from a where 1 -----------------------------------------------------------Description: copy a table (copy data, source table name: a target table name: B)SQL: insert into B (a, B, c) select d, e, f
records, tested access syntax: SELECT top * FROM table name ORDER by RND (ID) SQL Server syntax: SELECT TOP n * FROM table name ORDER by NEWID () MySql Syntax: Select * FROM table name Order by rand () Limit n Access left connection syntax (recent development to use left connection, Access Help nothing, online without access SQL instructions, just have their own test, now write down for later check) syntax
Colored SQL -- How to force the AWR to capture a specified SQL even if it is not the top one, SQL -- howawrThis new feature doesn' t paint the SQL statement in color; rather, it sort of marks it as "important ."Suppose you are troubleshooting a performance issue and you suspect a specific
Tags: style blog http io ar color using SP on This experience uses the SQL database migration Wizard (SQLAZUREMW) to migrate SQL Server 2008 databases to Azure SQL database. Of course, SQLAZUREMV can also migrate SQL Server 2005/2012/2014 to azure SQL Database. There are se
Label: Database parameterized mode There are two ways to parameterize a database, simple and mandatory (forced), and the default parameterization is "simple" by default.In simple mode, if the SQL is sent every time, unless it is exactly the same, it will be recompiled (special circumstances will be automatically parameterized, it is the focus of this article)The mandatory mode is to force the Adhoc SQL to b
Database parameterized modeThere are two ways to parameterize a database, simple and mandatory (forced), and the default parameterization is "simple" by default.In simple mode, if the SQL is sent every time, unless it is exactly the same, it will be recompiled (special circumstances will be automatically parameterized, it is the focus of this article)The mandatory mode is to force the Adhoc SQL to be parame
MS SQL Server Query optimization methodThere are many reasons for the slow speed of queries, which are common1, no indexes, or no indexes (this is the most common problem with query slowness, is the flaw in programming)2, I/o throughput is small, creating a bottleneck effect.3, no computed columns are created causing the query to be not optimized.4, Low memory5, network speed is slow6, query out the amount of data is too large (you can use multiple qu
"Customer Name": Guizhou Tongren driving Person Training Center"Software name": UF T3 Universal Edition"Database Version": MS SQL Server 2000 "database size": 1GB X 6 (3 accounts for a total of 6 years)."Problem description": Due to server poisoning or Kaka, the customer sent the server computer to the installed shop to redo the operating system. Not detailed to inform the use of the computer, resulting in the entire hard drive by the repair shop tech
C # convert SQL statements into paging SQL statements and obtain the number of records SQL statements
/// /// Convert the statement into a paging SQL statement. Two SQL statements that contain paging data are used to obtain the number of records.
1. view the database version
Select @ version
Common SQL server patch versions:
8.00.194 Microsoft SQL Server 2000
8.00.384 Microsoft SQL Server 2000 sp1
8.00.532 Microsoft SQL Server 2000 sp2
8.00.760 Microsoft SQL Server 2000 sp3
8.00.818 Microsoft
SQL Server manages common SQL and T-SQL (2)
1. view the database versionSelect @ versionCommon SQL server patch versions:8.00.194 Microsoft SQL Server 20008.00.384 Microsoft SQL Server 2000 sp18.00.532 Microsoft
a pair of values. For example, to_date ('2017-11-27 13:34:43 ', 'yyyy-mm-dd hh24: mi: ss') will get the specific time
String processing functions:
Select to_number (SUBSTR (rain_1, 0, 2), 'xx') from obs
(1) Access Database
We all know that there is an iif function in access, which can simplify a sequence of judgment values into an expression, suchIif (a> B, 1, 2). If a> B is true, 1 is returned; otherwise, 2 is returned. This is very convenient.
Exam
Tags: nbsp play clob Introduction ring LAN Solution Help SED 1. Brief introduction Oracle DATABASE11GR1 introduces SQL Planmanagement (SPM), a set of new tools that allow DBAs to capture and maintain discretionary SQL statements to run the best plan, limiting refresh optimizer statistics. There has been an application change. Even the impact of a database version number upgrade. This article helps to unders
conversion from: http://www.51testing.com /? Uid-239867-action-viewspace-itemid-103705
SQLDifferences between statements, PL/SQL blocks, and SQL * Plus commands
The SQL statement isDatabaseThe language of the operation object, including the data definition language DDL, data manipulation language DML, Data Control Language DCl, and data storage
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.