PHP.ini added date.timezone This option, which is turned off by default, that is, the time displayed (no matter what PHP command is used) is Greenwich Mean Time, and Beijing time is just 8 hours.
$time = Date ("y-m-d h:i:s");//Get current time
$con = mysql_connect ("localhost", "root", "123");
if (! $con)
{
Die (' Connect database failed! '. Mysql_error ());
}
Header ("content-type:text/html; Charset=utf-8 ");
mysql_select_db ("Test", $con);
mysql_query ("Set names ' UTF8 '", $con);
echo "China";
Switch ($type)
{
Case EDIT:
$sql = "Update test set id= ' $id ', pass= ' $password ' where id= ' $id '";
$qu = mysql_query ($sql, $con);
if ($qu)
{
echo "";
Exit
}
Break
Case ADD:
if (!mysql_query ("INSERT into Test (Id,pass) VALUES (' $id ', ' $password ')")
{
Die (' Data insertion failed! '). Mysql_error ());
}
Else
{
echo "";
Exit
}
Break
Case DELE:
$sql = "Delete from Test where id = ' $ID '";
$qu =mysql_query ($sql, $con);
if ($qu)
{
echo "";
Exit
}
Break
}
/*
Insert Database
*/
?>
Why $_get[' type ' does not take a value
------Solution--------------------
Switch ($type)
{
Case "Edit":
Add quotation marks
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