'usertest'GoExec sp_addrolemember n 'db _ datawriter ', N 'usertest'Go-- Logintest can only log on to the dbtest database, but we can access databases such as master and pubs.-- This is because there is a guest user in those databases, and the guest user can be associated with the login name of the user not set.-- That is, if logintest does not set associated users on the master database, the guest user is used.
-- Delete database users. before deleting login, you must delete all database users
completely equivalent to the original expression.
4. The role of in is equal to or.
Statement:
Select * From Table1 where TID in (2, 3) and select * From Table1 where tid = 2 or tid = 3
If they are the same, they will cause a full table scan. If there is an index on the TID, its index will also become invalid.
5. Use not as few as possible
6. The execution efficiency of exists and in is the same.A lot of data shows that exists is more efficient than in, and not exists should be used as much as
. category_id = jc. category_idWhere j. enabled = 1And js. last_run_outcome in (0, 1, 3, 5) -- 0: Fail 1: Succ 3: Cancel 5: First runAnd jc. category_id not between 10 and 20 -- repl--★★Query all the indexes of table tb in the database:★★★★★★★★★★★★★★★★★★Use dbGoSelectA. index_id, --- Index NumberB. name, --- index nameAvg_fragmentation_in_percent --- logical fragmentation of the IndexFromSys. dm_db_indx_physical_stats (db_id (), object_id (N 'create. consume '), null, null) asJoinSys. indexes as
. zend.com has a very simple RSS version. Paste the following text into a text file and save it as articles. xml.
Http://www.zend.com/zend/week/week172.php
Http://www.zend.com/zend/tut/tut-hatwar3.php
To load this example to a DOM object, you must first create a DOMDocument object and then load the XML file.
$ Dom = new DomDocument ();
$ Dom-> load ("articles. xml ");
As mentioned above, you can use the PHP Data Stream to load an XML document. You should write as follows:
$ Dom-> load ("file: //
need php (as the mainstream development language) 5 support**************************************** *********/
// Create a DOMDocument object first$ Dom = new DomDocument ();// Load the xml file (standardization is getting closer and closer ).$ Dom-> load ("test. xml (standardization is getting closer and closer )");
// Output the xml file (standardization is getting closer and closer)// Header ("Content-type: text/xml (standardization is getting closer and closer); charset = gb2312 ");// Echo
PHP cannot execute WHEREIN () using PDO to operate SQlite. please advise ~ This post was last edited by dlebh at 14:28:12
Php + sqlite
The titles field is an index!
$sql = "select * from fang where titles in('kill')";$result = $dbh->query($sql);$r = $result->fetchAll();
Error returned: Fatal error: Call to a member function fetchAll () on a non-object in
The statement can be executed normally w
PHP5 enhances XML support and uses DOM to extend the capabilities of XML operations. These functions are used as part of the PHP5 core and need not be installed. The following example simply demonstrates the DOM's operations on XML, which can be explained in detail in the comments in the code ?/************************************************* * Use XML in PHP5* * Reference site:* * http://cn.php.net/manual/zh/ref.dom.php* * The follow codes need PHP5 support*************************************
(standardization is getting closer and closer )");
// Output the xml file (standardization is getting closer and closer)// Header ("Content-type: text/xml (standardization is getting closer and closer); charset = gb2312 ");// Echo $ dom-> savexml (standardization is getting closer and closer )();
// Save the xml file (standardization is getting closer and closer), and the returned value is int (file size, in bytes)// $ Dom-> save ("newfile. xml (standardization is getting closer and closer )");
1. Use a For loop to traverse the videos and bookmarks array at the same time. For each video and bookmark pair, create a {videoid, bookmarkid} pair and add it to the Videoidandbookmarkidpairs array.function () {varVideos = [ { "ID":70111470, "title":" Die Hard", "boxart":"http://cdn-0.nflximg.com/images/2891/DieHard.jpg", "URI":"http://api.netflix.com/catalog/titles/movies/7011147
--1. Create the sample environment.First use the following code to create a login l_test and create an associated user account u_test for login in the database pubs, and give the user account U_test Select permissions on table titles to implement login L_test connect to SQL Server instance, you can access table titles. An application role R_p_test is then created that grants the role the SELECT permission f
, or other subquery.Subqueries can be used wherever expressions are allowed, and subqueries make our programming flexible and can be used to implement special functions. But in performance, often an inappropriate subquery usage can create a performance bottleneck. If a subquery's condition uses a field of its outer table, this seed query is called a correlated subquery.Correlated subqueries can be introduced with in, not in, EXISTS, not EXISTS. For related subqueries, it should be noted that:(1)
. There are many ways to do this. The simplest is to use getElementsByTagName ($ tagname ):
$ Titles = $ dom-> getElementsByTagName ("title ");
Foreach ($ titles as $ node ){
Print $ node-> textContent. "\ n ";
}
The textContent attribute is not W3C standard. it allows us to quickly read all text nodes of an element. The following is the standard reading of W3C:
$ Node-> firstChild-> data;
(At this time
Before Oracle9i appears, you can only export and import tables to redefine them. Therefore, table redefinition is an offline process. Even an online change to "alter table add NEW_COL NUMBER (3)") will lead to an exclusive locks deadlock. This requires that all DML inserts and updates be prevented before the DDL operation is completed.
To solve this problem, Oracle9i introduced the online table redefinition feature in its DBMS_REDEFINITION software package. With the DBMS_REDEFINITION package, yo
nested in SELECT, INSERT, UPDATE, DELETE statements, or other subqueries. Subqueries can be used wherever expressions are allowed. subqueries allow flexible programming and can be used to implement some special functions. However, in terms of performance, an inappropriate subquery may cause a performance bottleneck. If the sub-query condition uses the field of the outer table, this subquery is called the related subquery. You can use IN, not in, EXISTS, and not exists to introduce related subqu
. Paste the following text into a text file and save it as articles. xml.
Http://www.zend.com/zend/week/week172.php
Http://www.zend.com/zend/tut/tut-hatwar3.php
To load this example to a DOM object, you must first create a DOMDocument object and then load the XML file.
$ Dom = new DomDocument ();
$ Dom-> load ("articles. xml ");
As mentioned above, you can use the PHP Data stream to load an XML document. you should write as follows:
$ Dom-> load ("file: // articles. xml ");
(Or ot
How to output an html table from a php array. Copy the code as follows :? Phpclassxtable {private $ tit, $ arr, $ fons, $ sextra; publicfunction _ construct () {$ this-titarray (); stringswithtitlesforfirstrow $ this-arrarr
The code is as follows:
Class xtable{Private $ tit, $ arr, $ fons, $ sextra;Public function _ construct (){$ This-> tit = array (); // strings with titles for first row$ This-> arr = array (); // data to show on cells$ This-> f
The project needs to export the data in the table, found on the Internet find phpexcel good use. Share now Phpexcel
if (!defined (' BasePath ')) exit (' No Direct script access allowed ');
Material Hair Material List details
Class read_write{
/**
* $name: Selected type (csv,excel2003,2007)
* $titles: Header array
* $querys: The array returned by the query $query->result_array ();
* $filename
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.