Today I wrote a small program, small and small, just to build a link between PHP and MySQL, and implement simple SQL statements.
Novice preliminary interview, but also please a lot of experts to guide the road.
The program source code is as follows:
INSERT into Intl_order_tracking_no (Consolidator_no,ORDER_ID,Tracking_no,Sto_no,Batch_no,Order_type,Create_time)VALUES(#{consolidatorno},#{trackingno},#{stono},#{batchno},#{ordertype},#{createtime})#{connectorderitem}#{orderid}SQL if Else
if-thenStatements are the IF simplest form of a control statement and are often used to make decisions and change the control flow of program execution.IFA statement associates a condition with THEN a keyword and END IF a sequence of statements that
Why do I need dynamic SQL? Sometimes you need to dynamically stitch SQL statements based on the actual parameters that are passed in. The most common is: where and if tags1. Refer to the official documentation? If: Character judgment? Choose (When,
The structure of the Oracle IF statement is similar to most languagesIF condition then expr; elsif condition then expr; ELSE expr; END IF;As an example:Select count (Distinct index_name) INTO CNT FROM USER_INDEXES WHERE Table_name=c1. table_name;
Dynamic SQL is the dynamic generation of SQL.
If tag
Suppose there is such a requirement: Query the user, when the user name is not equal to "admin", we also need a password of 123456.
The data in the database is:
Mybatisconfig.xml
Like what:Select FirstName + lastName from employeeHere I want to first determine whether LastName is empty, if it is empty LastName returns the specified default value, and returns the value in the database without being empty.Select FirstName +
1) Dynamic language annotations(2) @Provider the use of ideas(3) @SelectProvider small test sledgehammer(4) @SelectProvider emerged(5) @SelectProvider through(6) @InsertProvider brother deserve(7) @UpdateProvider you add me to change(8) Delete
CompleteCodeUsing PHP to back up MySQL Databases
1. mydb. php // dB class2. Backup. php // backup script3. Restore. php // restore the script
Mydb. php
Class dB {
VaR $ linkid;VaR $ sqlid;VaR $ record;
Function dB ($ host = "", $
{Code ...} I don't know what's going on. I wrote it in reference books, but I just couldn't store it in the database. I copied the above Code on another page and printed the $ _ SESSION array, but it is empty. I don't know where the problem is?
How to let the switch statement jump out and execute it down
$ Type = $ _ POST ['type']; // You do not need to log on to switch ($ type) {case 1: // SQL read data 1 $ acase 2: // SQL read data 2 $ a} if ($ a) {}// if any data is read, an error die
Mysql connection operation class on the phpmysql website/* obtain the time of the last updated table in the SQL statement. if there are multiple tables, return the time of the latest table */
Mysql connection operations on the php mysql website
The recent work often need to back up the MySQL database on the remote server to the local computer, a direct backup of the MySQL data directory, but because of different coding reasons often arise. Later, my friend recommended me to use a very
DB Package ClassPHPclassdbda{ Public $host= "localhost"; Public $uid= "Root"; Public $pwd= "Root"; Public $dbname= "MyDB"; Public functionQuery ($sql,$type=1) //Connect to the database, the parameter defaults to 1 when the query results, the
Data Management esweb system data Management Data backup Data restore Data optimization /*--------------Interface--------------*/if (!$_post[' act ') {/*----------------------*/$MSGS []= "Server backup directory is $backup";$MSGS []=] for larger
[PHP public platform development series] 01. Configuration Interface02. Public platform sample code analysis03. subscribe Processing04. simple reply function development05. Development of the weather forecast function06. Development of translation
The code is as follows
Copy Code
?> Data Management esweb system data Management Data backup Data restore Data optimization /*--------------Interface--------------*/if (!$_post[' act ') {/*----------------------* *$MSGS []=
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.