Note:
1. The mysql statement should be capitalized. Remember to wrap each node in a new line, so that the SQL statement can be displayed more clearly to prevent this kind of error.
$sql="SELECT m.id, m.nav_name, m.nav_info, n.id iid, n.nav_name nnav_name FROM cms_nav m LEFT JOIN cms_nav n ON m.pid=n.id WHERE m.id=$this->id' or m.nav_name='$this->nav_name' limit 1";
2.parent is written as parent. . . How many letters are there
3. Write again
Look for errors:
1. Print the SQL statement to see if the syntax of the SQL statement is standardized, and whether the variables in it have been parsed or passed to the SQL statement
2. Comment the code that may cause the error, and then unravel it part by part to determine the error.
3. Write again
The above introduces how to reduce low-level errors in PHP code and the modification process, including aspects of the process. I hope it will be helpful to friends who are interested in PHP tutorials.