A php if statement is always not well written. -Php Tutorial

Source: Internet
Author: User
Tags parse error
Before that, the database code is read, and skipped here... Then, it won't happen .. {Code ...} problem 1: The first line returns the following error: PHPParseerror: syntaxerror, unexpected & #039; $ row & #039; (T_VARIABLE), expecting & #039; (& #039; inI: phpindex .... before that, the database code is read, and skipped here...
Then, it won't happen ..


  Ask someone for a name!
  Is this name good?
  

Question 1: The first line returns the following error:

PHP Parse error: syntax error, unexpected '$ row' (T_VARIABLE), expecting' ('In I: \ php \ index. php on line 119

Are there any other errors? unknown now

Question 2: Is there a quick way of writing, that is, writing in PHP, rather than mixing it with HTML? it seems that the execution efficiency will be very poor.

Okay, I admit it was changed from asp. I just learned PHP and I don't know where to look up these questions.

Reply content:

Before that, the database code is read, and skipped here...
Then, it won't happen ..


  Ask someone for a name!
  Is this name good?
  

Question 1: The first line returns the following error:

PHP Parse error: syntax error, unexpected '$ row' (T_VARIABLE), expecting' ('In I: \ php \ index. php on line 119

Are there any other errors? unknown now

Question 2: Is there a quick way of writing, that is, writing in PHP, rather than mixing it with HTML? it seems that the execution efficiency will be very poor.

Okay, I admit it was changed from asp. I just learned PHP and I don't know where to look up these questions.

Else missed the colon
There is no space in endif

If the last semicolon is changed to a colon, and then a semicolon is added after endif.

Conditions after if must be enclosed in parentheses


  Ask someone for a name!
  Is this name good?
  

The conditions after if should be enclosed in parentheses, $ row ['name]. here there is a single quotation mark missing, else should be changed to else:, and end if should be changed to endif;

$row['name]=""HerenameLess than one'Quotation marks. should there be two equal signs in this judgment?

PHP is inevitable for web development. You can also use the template engine, but now you still need to understand it.

Subject: How do I feel that you are using the CI framework.

The quick writing method is the template engine, and most of the frameworks are available now. For example, laravel's Blade

@ If ($ row ['name] = "" or is_null ($ row ['name'])Ask someone for a name!@ ElseIs this name good?@ Endif

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.