Common Errors in PHP

Source: Internet
Author: User

1. notice:undefined variable: variable name in note: Use a variable that is not defined 2, Parse error:syntax error, unexpected t_else in if () {}else if ( ) {} Echo $test; else {} Note: is if else if else syntax error 3, parse Error:syntax error, unexpected $end in D Note: Usually curly braces do not match 4, parse Error:syntax error , unexpected t_string in note: Generally forget to write a semicolon 5, warning:invalid argument supplied for foreach () in note: The first parameter of foreach must be an array of 6, Warnin G:MYSQL_FETCH_ASSOC (): supplied argument is not a valid MySQL results resource in Note: This indicates that the previous execution of the SQL return failure, typically SQL statement error, such as analysis does not come out , just can print out mysql_error (); See where it's wrong. 7, no database selected note: There is generally no connection to databases 8, Warning:mysql_connect () [Function.mysql-connect]: Access denied for   User ' root ' @ ' localhost ' (using Password:yes) in ..... On lines 3 Access denied for user ' root ' @ ' localhost ' (using password:yes) Note: Database username password wrong 9, Unknown ' cms07261′ Note: no this number  According to library 10, table ' cms0726.test ' doesn ' t exist Note: Table does not exist 11, Unknown column ' abc ' in ' Field List ' Note: field does not exist 12, column count doesn ' t match Value count at row 1 Note: The number of field values in the SQL statement is different than the number of field names 13, WarnIng:wrong parameter count for function name in NOTE: function is 14 less than number of numbers, Fatal error:smarty error: [In message_list.html lines]: Syntax err Or: ' Foreach:item ' must be a variable name (literal string) Note: Look at the line number, stating that the item after the foreach must be followed by a variable name, without $, is a string (note: No single-double-cited) 15, Fa Tal error:smarty Error: [In message_list.html line]: syntax error:unrecognized tag:msg.message_id NOTE: The variables in the template are missing $16, Wa Rning:smarty error:unable to read resource: ' message_list1.html ' in note: The template file could not be found to see if the file name was incorrectly written or stored in a different directory.  17, Fatal Error:cannot redeclare get_sort1 () (previously declared in note: function has already been defined, can not be redefined I hope this article is helpful to PHP program design.

  

Common Errors in PHP

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.