Delete: $exec = "Delete from tablename where ...";
Modified: $exec = "UPDATE tablename set item1= '". $_post[' item1 ']. "' Where ... ';
Speaking of which, we need to talk about the form and the PHP variable pass, if one of the forms
The form is submitted as a POST, then the form file can be processed using $_post[' item1 '] to get the value of the variable, and the same as get submitted is $_get[' item1 ']
Isn't it simple? But usually $exec can be problematic because your SQL statements may be long and you'll miss them. Connectors, or ' to surround a character field.
We can annotate mysql_query ($exec); The statement uses the Echo $exec, instead of outputting the $exec to check for correctness. If you are not aware of any errors in $exec, you can copy this SQL statement to phpMyAdmin to see if it has an error message. It is also important to note that we do not use sensitive strings as field names, or there are likely to be problems, such as date or something. The name of the variable, the name of the field follows a little regularity sometimes it is a benefit to oneself, the beginner should not neglect its importance.
Today, you can down a reference manual for a SQL statement, and then study the study. Go ahead and say the session tomorrow.
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.