Garbled characters appear after php is run

Source: Internet
Author: User
Php MySQL garbled after running





/* Member information deletion page */
Require_once ("D:/appserv/www/mr/01/webshop/conn/Conn_DB.php"); // contains the database link file
If ($ _ GET ['m _ id']! = "" & $ _ GET ["Type"]! = "")
{
$ Mid = $ _ GET ['m _ id']; // gets the passed member ID
$ Type = $ _ GET ["Type"]; // Obtain the passed operation type
$ Str = "";
Switch ($ type)
{
Case "1 ":
$ Str = "update Member_Info set M_Status = 1 where M_ID =". $ _ GET ['mid ']; // update the statement
Break;
Case "2 ":
$ Str = "update Member_Info set M_Status = 2 where M_ID =". $ _ GET ['mid ']; // update the statement
Break;
Case "3 ":
$ Str = "delete from Member_Info where M_ID =". $ _ GET ['mid ']; // delete a statement
Break;
}
$ I = mysql_query ($ str); // execute an SQL statement
If ($ I) // judge the execution result
{
Echo "script" alert ('Operation successful! '); Window. location. href =' ../member_manager.php 'script ";
}
Else
{
Echo "script alert ('Operation failed! '); Window. location. href =' ../member_manager.php 'script ";
}
}
Else
{
Echo "script" alert ('Please reselect the member information you want to operate! '); Window. location. href =' ../member_manager.php 'script ";
}
?>


This is part of the code


Reply to discussion (solution)

This will happen after running.

You posted no garbled content

Why is that?

No gibberish. are you just learning programming?

Well, isn't that abnormal?

$ I = mysql_query ($ str );
This sentence is changed
$ I = mysql_query ($ str) or die (mysql_error (); // Check the error message

It is still the same as before. I can send this complete information to you and run it for me to see if this program is a problem?

The student party asks for help, which is an example on the internet. could you help me to see this program!

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.