I don't know what the error is. Lines 7 and 8 report an error.

Source: Internet
Author: User
I don't know where the error is returned in lines 7 or 8. & lt ;? Include (& quot; includesconfig. php & quot;); error lei (0); $ ii0; functionlei ($ belongs_id) {$ sqlmysql_query (& quot; select * frompro_typewherebelongs_id & q. I don't know where the error is. rows 7 and 8 report an error.
Include ("des/config. php ");
// Line 7 and 8 report an error
Lei (0 );
$ Ii = 0;
Function lei ($ belongs_id ){
$ SQL = mysql_query ("select * from pro_type where belongs_id = '". $ belongs_id. "'", $ conn );
While ($ rs_info = mysql_fetch_array ($ SQL )){
// Category
If ($ belongs_id = 0 ){
Echo "category ";
} Else {
Echo "small class ";
}
$ Ii = $ ii + 1;
Lei ($ rs_info ["id"]);
$ Ii = $ II-1;
}
}
?>

------ Solution --------------------
It is found that it is a problem of variable scope. The variable in the function is a local variable. $ conn must be declared as global if you want to use a global variable.
------ Solution --------------------
PHP code
  
------ Solution --------------------
Do you want
Global $ conn;
$ SQL = mysql_query ("select * from pro_type where belongs_id = '". $ belongs_id. "'", $ conn );

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.