Unexpected 'foreach' (T_FOREACH) Prompt for batch deletion in PHP)

Source: Internet
Author: User
Tags parse error
{Code ...} error message: PHPParseerror: syntaxerror, unexpected & #039; foreach & #039; (T_FOREACH) inI: php-moivesearch_delall.phponline7 Baidu "unexpected & #039; foreach & #039; (T_FOREACH) ..

  

Error message:PHP Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in I: \ php-moive \ search_delall.php on line 7
Baidu"Unexpected 'foreach' (T_FOREACH)..

Reply content:

  

Error message:PHP Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in I: \ php-moive \ search_delall.php on line 7
Baidu"Unexpected 'foreach' (T_FOREACH)..

If (is_array ($ id )&&! Empty ($ id) {<-- the braces are fully enclosed.

unexpected xxxError MessageFrontSyntax error.

Brackets in Chinese

if(is_array($id) && !empty($id)){

The syntax should be correct. The error is in parentheses. If the $ id is an array, concatenate the string and directly delete from mysearch where Id in string. You no longer need to traverse and execute multiple SQL statements.


  

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.