MySQL can be created in the http: // localhost/phpMyAdmin/index. php database. (Stateless table)
MySQL and PostgreSQL are both available in PHP.
The following is a simple example of PHP access between the two.
Furthermore, it should be noted that the PostgreSQL code here actually cannot work.
In actual tests, the SQL programming document [Editing] is used in PostgreSQL.
For more information about PostgreSQL, see here and there.
MySQL is a constant code for actual operations.
The "MySQL" section of the SQL program design document contains the new MySQL version.
The latest MySQL has added support for ODBC and JDBC access for transaction functions.
Create a database
MySQL can be created in the http: // localhost/phpMyAdmin/index. php database. (Stateless table)
Project Type table (field type) MySQL field type
Int/integer |
4-byte integer |
Smailint |
2-byte integer |
Bigint |
8-byte integer |
Float |
Floating decimal point |
Double/real |
Precision Floating decimal point |
Date |
Date |
Time |
Time |
Timestamp |
Date and time |
Char (number of characters) |
Fixed long sentence column (256 words at most) |
Varchar) |
Columns that can be changed with long sentences (up to 256 words) |
Text |
A large number of strings (up to 60 thousand 5535 characters) |
Mediumtext |
A large number of strings (up to 1.67 million 7215 characters) |
Largetext |
A large number of strings (up to 4.2 billion 94.96 million 7295 characters) |
Blob |
A large number of binary (up to 65535 bytes) |
Mediumblob |
A large number of binary (up to 1677215 bytes) |
Largeblob |
A large number of binary (up to 4294967295 bytes) |
Create a table
create table test (key1 char(8) primary key,data1 bigint,data2 bigint,data3 bigint);
- It is good to be able to manipulate the relational database management system in the browser.
In addition to availability, we have excellent services on the network.
- In MySQL, text cannot be used as the table name or field name, which is wrong.
In addition, it cannot be used as a reserved word to specify the project name.
On a UNIX server, table names are different from uppercase or lowercase letters.
Project names are uppercase letters and lowercase letters.
Create a table, but it can be interactive and direct. it is easier to pour it into a query.
- The sentence structure of SQL is different in project type and cannot be managed in Japanese, which is roughly the same as that of Oracle.
It is best to refer to the SQL programming language documents.
Delete table
drop table test;
Delete project
alter table test drop data2;
Limit the number of queries
select * from test where key1 like 'a%' limit 0, 10;
MySQL queries the specified quantity limit
Limit 0, 10
| _ Number of searches
| _ Number (first line = 0)
If you specify.
Delete index
drop index ix_key on test;
To delete an index in MySQL, on specifies the name of a table.
Sequential item (automatic number)
In MySQL, auto_increment is specified.
create table test (keyno auto_increment primary key,data1 bigint,data2 bigint,data3 bigint);