We are familiar with the basic operations of databases and database tables. Now let's take a look at how to operate multiple tables.
Multi-Table operations
Multiple tables may exist in a database, which are associated with each other. We will continue to use the previous example. The preceding table contains basic information about an employee, such as name, gender, date of birth, and place of birth. Create another table to describe the articles published by employees, including the author's n
We will continue to use the previous example. The preceding table contains basic information about an employee, such as name, gender, date of birth, and place of birth. Create another table to describe the articles published by employees, including the author's name, article title, and publication date.
1. view the content of mytable in the first table:
Mysql> select * from mytable;+ ---------- + ------ + ------------ + ----------- +| Name | sex | birth | birthaddr |+ ---------- + ------ + ----
, and the returned substrings are in an array. Split can use regular expressions or plain text as delimiters.
Try this:
>> "Ruby". Split (//)=> ["R", "U", "B", "Y"]Converts the content of a text-based configuration file into Ruby's data structure.
>> line = "First_name=matt;last_name=damon;country=usa"=> "First_name=matt;last_name=damon;country=usa">> record = Line.split (/=|;/)=> ["First_Name", "Matt",
that start httpd users have permission to read
Please go to the following address to search for patches
Internet Information Server:
ftp://ftp.microsoft.com/bussys/iis/iis-public/fixes/usa/Viewcode-fix/
Site Server:
ftp://ftp.microsoft.com/bussys/sitesrv/sitesrv-public/fixes/usa/siteserver3/hotfixes-postsp2/Viewcode-fix/
Http://www.microsoft.com/security/products/iis/checklist.asp
Recommendation: Delete or
mysql| Backup | data | database
Multi-table Operations
In a database, there may be multiple tables, all of which are interrelated. We continue to use the previous example. The table previously established contains some basic information about the employee, such as name, sex, date of birth, place of birth. We'll create a table that describes the articles published by the employee, including the author's name, the title of the article, and the date of publication.
1, view the contents of the first
), (7,1, ' EA ', 1.00), (10,2, ' EA ', 1.00), (11,15, ' EA ', 1.00), (12,3, ' EA ', 1.00), ( 13,4, ' EA ', 1.00), (14,2, ' ML ', 205.00), (15,7, ' EA ', 13.00), (16,12, ' G ', 15.00), (17,16, ' G ', 15.00)CREATE TABLE dbo. Cities(Cityid char (3) NOT null primary key,City varchar (+) is not NULL,Region varchar (+) NULL,Country varchar (+) NOT NULL);CREATE TABLE dbo. Roads(City1 char (3) NOT NULL references dbo. Cities,City2 char (3) NOT NULL references dbo. Cities,distance int NOT NULL,Primary KE
versions), the length is not limited, but the execution efficiency may be affected.
Separator
Optional. Set the field delimiter (only one character is allowed). The default value is comma.
Enclosure
Optional. Set the field surround character (only one character is allowed). The default value is double quotation marks.This parameter is added in PHP 4.3.0.
Tips and comments
Note: empty rows in the CSV file will be returned as an array containing a single null field a
Optional. Sets the field wrapping character (only one character is allowed), and the default value is double quotation marks.This parameter is added in PHP 4.3.0.
Hints and notes
Note: Empty rows in a CSV file are returned as an array containing a single null field and will not be treated as an error.
Note: This function is sensitive to locale settings. Let's say LANG is set to en_US. UTF-8, a single-byte encoded file will receive a read error.
Note: You can activate the Auto_detec
Usage of fgetcsv and compatibility issues in windows and linux
$ File = fopen ("contacts.csv", "r ");
Print_r (fgetcsv ($ file ));
Fclose ($ file );
?>
CSV file: George, John, Thomas, USA James, Adrew, Martin, USA output is similar: array ([0] => George [1] => John [2] => Thomas [3] => USA)Example 2:
parameter is ignored (set to 0 in PHP 5.0.4 and later versions), the length is not limited, but the execution efficiency may be affected.
Separator
Optional. Set the field delimiter (only one character is allowed). The default value is comma.
Enclosure
Optional. Set the field surround character (only one character is allowed). The default value is double quotation marks.This parameter is added in PHP 4.3.0.
Tips and comments
Note: empty rows in the CSV file will be
sender, EventArgs e) {// instantiate the database object ObjectContext NorthwindEntities myTestDB = new NorthwindEntities (); var donews = from customer in myTestDB. MERs where customer. country = "USA" select new {id = customer. customerID, name = customer. contactName, city = customer. city, country = customer. country}; GridView1.DataSource = donews; GridView1.DataBind (); // you need to convert the query result to an ObjectQuery instance to track
(only one character is allowed). The default value is double quotation marks.This parameter is added in PHP 4.3.0.
Tips and comments
Note: Empty rows in the CSV file will be returned as an array containing a single null field and will not be treated as an error.
Note: This function is sensitive to region settings. For example, if LANG is set to a en_US.UTF-8, a single-byte encoded file will have a read error.
Note: If PHP cannot recognize the row terminator of the Macintosh file when read
I bet you don't know. At Microsoft's Chinese Research Institute, we have many world-class multimedia research experts. -- Bill Gates
Dr. Lee Kai-Fu
Dr. Zhang yaqin
Dr. Zhang HONGJIANG
Dr. Shen Xiangyang
Dr. Xu fengxiong
Dr. Zhang yizhao
Dr. Guo baining
Dr. Wang Jian
Lin Bin
Dr. Ma weiying
Dr. Zhou Ming
Dr. Zhu wenwu
Dr. Li Shipeng
Dr. Wu Feng
Dr. Gao Jianfeng
Dr. Zhang Qian
Dr. Tong
Tag: Access end uses the ONS port subscript ble. Text headerCSV, whose files store tabular data (numbers and text) in plain text, CSV records are separated by some sort of line break and other characters, common commas or tabs,
For example:
#coding:utf-8import csvheaders = [‘ID‘,‘UserName‘,‘Password‘,‘Age‘,‘Country‘]rows = [(1001,"guobao","1382_pass",21,"China"), (1002,"Mary","Mary_pass",20,"USA"), (1003,"Jack","Jack_pass
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.