About foreach output
$ Sql1 = "select * from y_cate order by asc ";
$ Result1 = mysql_fetch_array (mysql_query ($ sql1 ));
Var_dump ($ result1 );
Foreach ($ result1 as $ ke => $ ){
Echo $ ."
";
}
?>
I want to use foreach to output all the data in the cate table cyclically. Why does it output only one piece of data? Answer
Reply to discussion (solution)
$sql1="select * from y_cate order by asc";$resu
SQL Server Stored Procedure paging code and instructions using vc # Call the above Stored Procedure
SQL Server Stored Procedure paging code and instructions using vc # Call the above Stored Procedure
The Code is as follows:
Declare @ TotalCount int
Declare @ TotalPageCount int
Exec P_viewPage_A 'type1', '*', 'id', ', 'Id asc', @ TotalCount output, @ TotalPageCount output
Select * from type1
Create PROC P_viewPage_A
/*
Nzperfect [no_mIss] efficient
Copy Code code as follows:
DECLARE @TotalCount int
DECLARE @TotalPageCount int
exec p_viewpage_a ' type1 ', ' * ', ' id ', ', ' ID ASC ', 1,0,4,3, @TotalCount output, @TotalPageCount output
SELECT * FROM Type1
Create PROC p_viewpage_a
/*
Nzperfect [No_miss] Efficient common paging stored procedure (bidirectional retrieval) 2007.5.7 qq:34813284
Warning: Tables or views that apply to a single primary key or existence of a unique value
SQL Server database paging query has been SQL Server's short board, Idle to do nothing, think of several methods, assuming that there is a table article, Field ID, year ... (other omitted), Data 53,210 (customer real data, amount of small), page 30 per page, query page 1500th (that is, 第45001-45030条 data), field ID clustered index, Year no index, SQL Server version: 2008R2The first scenario, the simplest and the most common method :Copy CodeThe code is as follows:Select top article WHERE ID not
)] [GROUP by Group Field 1 [, Group Field 2,...]] [Order by sort field ASC | DESC [, sort field ASC | DESC]];Example: GROUP by department number, find the number of each department, average wageSELECT Deptno, COUNT (empno), AVG (SAL) from Empgroup by Deptno;Example: find the highest and lowest wages for each position, grouped by positionSELECT job, MAX (SAL), MIN (SAL) from Empgroup by job;But now, once gro
operator overhead, the estimated number of rows, and the object and query conditions of the operation, all of which provide favorable evidence for optimizing the query. 1th, the 3 diagram IO overhead is relatively large, the 2nd graph estimates the number of rows is larger, and then according to other information, the first thought should be to build the index, not the words to change the query. Let's take a look at what optimization information the Database Engine Tuning Advisor can give us, a
the operation, all of which provide favorable evidence for optimizing the query. 1th, the 3 diagram IO overhead is relatively large, the 2nd graph estimates the number of rows is larger, and then according to other information, the first thought should be to build the index, not the words to change the query.Let's take a look at what optimization information the Database Engine Tuning Advisor can give us, and sometimes it can help us provide useful information, such as creating statistics, inde
Article Title: echo and sudo. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
As we all know, using echo and command redirection is a quick way to write information to a file. This article describes how to use echo and sudo commands to write information to files that only the system administrator has the permission to operate.
For example, if you want to writ
The so-called data movement in DB2 includes:1. Import Data)2. Data Export (Export)3. Load)
Both import and load use DB2 commands to save data in files of a certain format to tables in the database.Export refers to saving the data in the table of the DB2 database to a file of a certain format.
The role of data movement:
To transfer data between different database management systems, data movement is usually the most practical method, because any database management system supports common file for
len (username) from admin) >5//Return error and
(select top 1 len (username) from Admi N) =5//return correct, stating that the word length of username is five, most likely the decision of the admin
password field: And
(select top 1 len (password) from admin) >16/ /Return error
and (select top 1 len (password) from admin) =16//return correct, stating that the password word length is 16 bits, most likely MD5 encrypted. 00x4 [Guess the Administrator account]//use ASCII conversion to get encrypte
The so-called data movement in DB2, including:1. Importing data (Import)2. Exporting the data (export)3. Loading of data (load)Both import and load are used to save data from a file in a format to a table in a database using DB2 's related commandsExporting refers to saving data from tables in a DB2 database to a file in a certain format.The role of data movement:If you want to transfer data between different database management systems, data movement is often the most practical method, because
The article found two efficient paging codes for the mssqlserver stored procedure. If you need them, please refer to them.
The article found two efficient paging codes for mssql server Stored Procedures. If you need them, please refer to them.
The Code is as follows:
Create PROC P_viewPage/**//*Nzperfect [no_mIss] efficient and common stored procedure (bidirectional retrieval) 2007.5.7 QQ: 34813284Tip: Applicable to tables or views with a single primary key or a uniq
mId(Username, N, 1) truncates the nth character, and then asc (mid (username, N, 1) to obtain the ASCII code.Guess the userAnd (select top 1 asc (mid (username,) from Admin)>, 2 ...,When the input is 109, an error is displayed. If the input is correct before 108, the ASCII code of the first character is 109, and the first character is m.Similarly, and (select top 1 asc
Original post http://hi.baidu.com/rich0411/blog/item/fa0c61ee3a68502e2df534bc.html
The so-called data movement in DB2 includes:
1. Import Data)
2. Data Export (Export)
3. Load)
Both import and load use DB2 commands to save data in files of a certain format to tables in the database.Export refers to saving the data in the table of the DB2 database to a file of a certain format.
The role of data movement:
To transfer data between different database management systems, data movement is usually th
A stored procedure that still feels good.
The code is as follows
Copy Code
/****** object: StoredProcedure [dbo]. [P_viewpage] Script Date: 05/14/2012 08:49:34 ******/SET ANSI_NULLS onGoSET QUOTED_IDENTIFIER ONGo Create PROC [dbo]. [P_viewpage]--Add The parameters for the stored procedure@TableName VARCHAR (200),--table name@FieldList VARCHAR (2000),--Display column names, if all fields are *@PrimaryKey VARCHAR (100),--single primary key or unique value key@Where VAR
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.