This article describes the implementation method of Php+mysql+ajax lightweight chat room. Share to everyone for your reference, specific as follows:Do a QQ chat dating site, want to add a chat function, so finished using PHP to do a simple and
The code is as follows
Copy Code
Database processing ClassesClass db{The data save variables after SQL execution;var $db;Reads or sets the location of the current datavar $position = 0;Execute the SQL statement and save the result
We use the simplest method directly with Php+mysql to achieve, the method is as follows.
The code is as follows
Copy Code
Include (' db/db.php '); Include a library class$db = new db ();$result = mysql_query (' select *
MySQL Getting Started tutorial Chapter
MySQL database query
SELECT * FROM tableSELECT * FROM table1, table2, ...SELECT field1, Field2, ... From table1, table2, ...SELECT ... From ... WHERE conditionSELECT ... From ... WHERE Condition GROUPBY
The article examples of MySQL's 1067 errors in a variety of solutions, so that people encounter this error can quickly refer to the solution.
Content:
MySQL Error 1067: Process terminated unexpectedlyThis problem bothered me for a morning, very
Where optimizations are primarily in the Select, because they are used most largely, but the same optimizations can be used for delete and UPDATE statements.
However, please note that the following optimizations are not complete. MySQL has
MySQL Modified password Method summary
The first thing to declare is that in most cases, MySQL needs to have root privileges in MySQL, so the general user cannot change the password unless the administrator is requested.
Method One
Using
The group by function should be used if each column specified in the select list must also appear in the GROUP by clause, unless the column is used to aggregate functions, but today I am going to help my colleagues debug a group by function in MySQL,
In order to be able to use replace, you must have both insert and delete permissions for the table.
The Replace statement returns a number that indicates the number of rows affected. This number is the same as the number of rows that were deleted
MyISAM: This is the default type, which is based on the traditional ISAM type, and ISAM is the abbreviation for indexed sequential access method (indexed sequential access methods), which is the standard way to store records and files. Compared to
Query statement:SELECT field name from table name.Sort order by the name of the field to sort by desc: query in reverse order.Limit how many to start from: Find a specified number.Querying multiple fields at the same time is separated by ",".If all
Operator PrecedenceThe following list shows the order in which operator precedence is from low to high. Operators that are arranged on the same line have the same precedence.
:=
| |, or, XOR
&&, and
Not
BETWEEN, case, when, THEN, ELSE
=, , >=,
Each language will have some keywords or reserved words, MySQL is no exception, here are listed, easy to query:
MYQL keyword list, mark.
ADD all ALTER ANALYZE and as ASC asensitive before BETWEEN BIGINT BINARY
ADD
All
Alter
Host172.16.0.21172.16.0.22centos6.2Use yum to install MySQL separately
Create a new library for MySQL on 21
CREATE DATABASE ' replytest1 '/*!40100 DEFAULT CHARACTER SET UTF8 * *;
Building a table
CREATE TABLE ' replytest1 '. ' Test1 ' (' ID '
difference Contrast
Stores
TIMESTAMP
1.4-byte storage (time stamp value was stored in 4 bytes)
2. Value is saved in UTC (It stores the number of milliseconds)
3. Time zone conversion, storage time for the current time zone conversion, retrieval
1, download mysql-free version/binary plate software (do not compile)
File format: mysql-version-os.tar.gz
2, the creation MySQL group, establishes the MySQL user and joins in the MySQL group
(in different versions of UNIX, the syntax for
Recently, I want to develop an information management system for the company from the development machine (Windows NT IIS4.0 Access) migrating to a real Linux server (Apache1.3.12 PHP 4.03 MySQL 3.23.26), the migration of content from dozens of
MySQL 3.23.40 is released again.Fixed -- low-priority-updates and INSERT.Fixed the problem that the master process was 22 bytes ahead of the master process in some special circumstances.Added slave_wait_timeout for replication.Corrected the issue of
SummaryIn this chapter, we will focus on how to use Structured Query Language (SQL) to work in MySQL databases.(14:11:10)--------------------------------------------------------------------------------By Wing, source: LinuxaidChapter 2: Getting
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service