When you operate access and MSSQL, You need to execute a SELECT query to obtain the new insert Record ID. in MySQL, use $ newid = mysql_insert_id (); you can easily obtain the ID of the newly inserted record. The methods for getting new insert records for access, MSSQL, and MySQL databases are sorted out for reference.
In this series, I have always compared MYSQL and SQL Server. comparison is a good way to learn the same things, to deepen memory
The same is true for this article, which compares with MSSQL to learn MYSQL (7). the same content is skipped. I will give an example in different parts, thank you for your support of o (∩ _ ∩) o.
This section describes basic queries in
In MySQL, The While statement loop is different from that in SQL Server, and the code passes the test.In MSSQL, The while statement is used to generate data cyclically:Sample Code:Copy codeThe Code is as follows:Declare @ a intSet @ a = 1While @ a BeginInsert into demotable (id, item1, item2) VALUES (@ a, "abc", "123 ")Set @ a = @ a + 1End In MySQL, The while loo
In MySQL, The While statement loop is different from that in SQL Server, and the code passes the test.
In MSSQL, The while statement is used to generate data cyclically:
Sample Code:Copy codeThe Code is as follows: declare @ a intSet @ a = 1While @ a BeginInsert into demotable (id, item1, item2) VALUES (@ a, "abc", "123 ")Set @ a = @ a + 1End
In MySQL, The w
, permanent free.
Free space features: Space Unlimited Permanent free provides you with unlimited storage space, enough to accommodate thousands or even millions of web pages, and can be used permanently for free! Domain name binding and forwarding you can bind (or forward) your own domain name, and you can bind (or forward) a domain name to a subdirectory! Web Management ftp management through online (WEB) and FTP two ways and online decompression/compaction, and other powerful fea
//php and MySQL database connection code
The code is as follows
Copy Code
mysql_connect (' localhost ', ' root ', ' root ') or Die (' MySQL server stop or use password error! ');mysql_select_db (' cshouse ') or Die (' datebase error ');mysql_query ("Set Names ' GB2312 '");
PHP connects Access database code
The code is as follows
Copy Code
$
.------------------------------ID name ID score------------------------------1 Lee 1 902 Zhang 2 1004 Wang null------------------------------*/
-- Right outer join is equivalent to right outer join)Select * From Table1 right Outer Join Table2 on table1.id = table2.id;/*Note: all the clauses containing Table 2 return the corresponding fields of Table 1 Based on the specified conditions. The non-conforming fields are displayed as null.------------------------------ID name ID score-----------------
(starting from 1) line:548
The code is as follows
Copy Code
/********************************************************************************** This class encapsulates database operations with good portability for databases: MYSQL,MSSQL,PG * Original Author: Andrzej Manczyk finishing: Jade face e-mail/msn:xiuluo-999@163.com Time: 2006-12-20* *********************************
mssql_query ("set textsize 65536.3. there are two problems with different field types in the two databases. One is that the maximum length of a field is supported to avoid being truncated during database insertion, another problem is the date format. I prefer UNIX timestamps. When connecting to MSSQL, you can use "select unix_timestamp (created) from news" to convert DATETIME to
use mssql_query ("set textsize 65536.
3. there are two problems with different field types in the two databases. One is that the maximum length of a field is supported to avoid being truncated during database insertion, another problem is the date format. I prefer UNIX timestamps. When connecting to MSSQL, you can use "select unix_timestamp (created) from news" to convert DATETIME to
Generation principle, to generate a random number between the A-B (pure number ):
Select floor (a + (RAND () * (B-A + 1 )))
MSSQL generates random numbers in batches:Select ceiling (100 * rand (checksum (newid () from Table1
Select floor (100 * rand (checksum (newid () from Table1
MySQL generates random numbers in batches:Select floor (200 + (RAND (UUID () * 351) from Table1
Simple analysis:Flo
If you use this statement in MS SQL Server:
The code is as follows
Copy Code
Select Top 2 * from test01
Oracle's statement:
The code is as follows
Copy Code
SELECT * FROM (select RowNum r, * from test) Ttwhere TT.R > and TT.R
(preferably with a plsql cursor)
In DB2:
The code is as follows
Copy Code
SELECT * FROM payment to fetch first 5 row only--check the top 5 records
Mssql
The code is as follows
Copy Code
$server = ' HBDS3 ';$username = ' username ';$password = ' pwd ';$database = ' database ';$conn =mssql_connect ($server, $username, $password)Or Die ("couldn ' t connect to SQL Server on $server");$db =mssql_select_db ($database) or Die ("couldn ' t Open database $database");
Oracle
The code is as follows
Copy Code
$conn = Oci_connect ("DatabaseN
Detailed description of mysql, mssql, and oracle paging query methods, mssqloracle
This article describes mysql, mssql, and oracle paging query methods. Share it with you for your reference. The specific analysis is as follows:
Paging query is the most common technology in web development. Recently, I have learned a li
people can be used to suffer.
The quiz exam libmysql into windows/system32 and libmysql.dll copy to Apache/bin.
Of course, the easiest way to do this is:
In Apache:
LoadFile D:/php/php5.2.13/libmysql.dll
Only this line, MySQL can be successfully appropriated.
My server version: Win7
Apache 2.2.13
PHP 5.2.13
mysql5.1.37
phpmyadmin3.3.2
Below is the layout of my Apache department.
Phpinidir d:/php/php5.2.13 #不是必须
LoadFile D:/php/php5.2.13/php5ts.dll
Lo
Tags: img nal gem format MSS Star Cap BSP TleTransferred from: Https://www.jianshu.com/p/15a557ac43d91. Connect to MySQLFirst step, create a new ASP. NET Core ProjectNew ProjectThis routine is a simple demonstration of the connection between the two databases, creating a new default Webapi project and adding the MySQL. NET core package to the current preview version. Note: Core 1.0 1.1 can be used with MySQL
"Guide" large Web sites generally use Oracle or DB2, while the majority of small and medium-sized Web sites use a more flexible and compact MSSQL database or MySQL database. So, under the same conditions, Microsoft's MSSQL and free MySQL which is more secure?
Databases are the basis of E-commerce, finance, and ERP sys
1: SQL Server date type:
For 'yyyy-MM-DD hh: mm: SS
2. MySQL Date and Time type:Date. The supported range is '2017-01-01 'to '2017-12-31 '. MySQL displays the date value in 'yyyy-MM-DD 'formatDatetime, a combination of date and time. Supported range: '2017-01-0100:00:00 'to '2017-12-31 23:59:59 '. MySQL with 'yyyy-MM-DDDisplay the datetime value in HH: mm: ss' fo
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.