1,php Connection Database
$dbhost = ' localhost ';
$dbuser = ' root '; Your MySQL user name
$dbpass = ' 123456 '; Your MySQL password
$dbname = ' data '; Your MySQL library name
Connecting to a local database
$GLOBALS ["conn"] = mysql_connect
Do not know how to solve, so put his space on the server also installed a MySQL, to solve the problem, today there is a problem, you can not also install a MySQL on this server, Search:
PHP remote connection MySQL slow, sometimes remote connection
---space---
String Gbspace (String)---------spaces between each text
String Gbunspace (String)-------white space between each text
String Clear_space (String)-------used to clear extra spaces
---conversion---
String gbcase
PHP's commonly used numeric judgment function
Judging arrays
$colors = Array ("Red", "Blue", "green");
if (Is_array ($colors))
{
Print ("Colors is an array". "
");
}
Double Precision number judgment
$Temperature = 15.23;
if (is_double
Implementation of friendly URLs (recommended for vomiting)
You often see other stations of the URL is this it?
Http://www.xxx.com/module/show/action/list/page/7
Or
Http://xx.com/module/show/action/show/id/8.shtml with a name
Main Compatibility: PHP 5
First, chdir--Change the catalogue
Syntax: BOOL ChDir (string directory)
return value: Integer
Function Type: File access
Content Description:
Change the current directory of PHP to directory. Directory: The new current
The PHP batch gets the value of the checkbox
1. Naming
2. Use
When the plan is part of a SQL instruction: if the field that participates in the control is numeric, the
if (! empty ($_post[' checkbox '))) {
$expr = Join (",", $_post[' checkbox
(The main reference to the volcano's post: ★flash and ASP Communication Primer Tutorial-do really belong to their own message book!) )。 There is no better online PHP message-related tutorials, I downloaded n multi-source files are foggy, and many of
/**
* Remove blank elements from the array (including elements with only whitespace characters)
*
* @param array $arr
* @param boolean $trim
*/
Copy CodeThe code is as follows:
Function Array_remove_empty (& $arr, $trim = True)
{
foreach ($arr as
On Unix (Linux), after installing MySQL in accordance with the instructions in the manual, you must run the mysql_install_db script to build the containing authorization
The table's MySQL database and initial permissions. On Windows, run the Setup
Copy CodeThe code is as follows:
Class Lightpage_template {
var $Tpl _header;
var $Tpl _footer;
var $Tpl _parsing;
var $Tpl _template;
var $Tpl _dirname;
var $Tpl _parse_string;
var $Tpl _parse_array;
var $Tpl _result;
function __construct () {
First, we show you how to query data by table only son values.
Task Objective: Enter the department name in the form and inquire the personnel information of the corresponding department.
Create the search.php file first.
The first step is to
So I joined in the program: mysql_query ("SET NAMES GB2312"); the problem is solved. is mainly a coding problem.
Note that the insertion position of this code should be inserted before the code that displays the data, otherwise it will be
page.php
Copy CodeThe code is as follows:
/**
* * Generic PHP paging class. (Imitation Google style)
* * Simply provide two parameters for the total number of records and the number of displays per page. (Detailed usage instructions are attached.)
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