Difference between revisions of "PHP Error Messages"

From PustakaPedia
Jump to: navigation, search
(Created page with "''': syntax error, unexpected '...' (T_VARIABLE) in''' <br/> Please check the commas, semicolons from the previous lines which may not be present<br/><br/> ''': mysqli_quer...")
 
(Types of Error Message)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
==Displaying Error Message==
 +
To display error message for troubleshooting, simply insert mysqli_error($yourconnectionvariable) after each query statement. This will display exactly the error type and which lines does it effect.<br/>
 +
However, this error message display has to be removed once the function has gone live. This is because it can indicate line error to users using the function thus making the function vulnerable for hacking.<br/>
 +
 +
==Types of Error Message==
 +
 
''':  syntax error, unexpected '...' (T_VARIABLE) in''' <br/>
 
''':  syntax error, unexpected '...' (T_VARIABLE) in''' <br/>
 
Please check the commas, semicolons from the previous lines which may not be present<br/><br/>
 
Please check the commas, semicolons from the previous lines which may not be present<br/><br/>
  
 
''':  mysqli_query() expects parameter 1 to be mysqli, null given in''' <br/>
 
''':  mysqli_query() expects parameter 1 to be mysqli, null given in''' <br/>
Please check on the MySQLi connection, whether the variable '$con' has the correct spelling or not
+
Please check on the MySQLi connection, whether the variable '$con' has the correct spelling or not<br/><br/>
 +
 
 +
'''Notice :  Undefined variable: ... in .... on line ...''' <br/>
 +
Please check on the variable declared on the line indicated, whether it was undefined earlier or there maybe duplication on the usage of the variable<br/><br/>
 +
 
 +
'''Warning :  mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in  in .... on line ...''' <br/>
 +
Please check on the table or field name where the result is intended to be stored<br/><br/>
 +
 
 +
'''Notice: Undefined index: ... in ... on line ...'''<br/>
 +
Please check on the field name whether it exists or not in table<br/><br/>

Latest revision as of 12:01, 18 February 2019

Displaying Error Message

To display error message for troubleshooting, simply insert mysqli_error($yourconnectionvariable) after each query statement. This will display exactly the error type and which lines does it effect.
However, this error message display has to be removed once the function has gone live. This is because it can indicate line error to users using the function thus making the function vulnerable for hacking.

Types of Error Message

: syntax error, unexpected '...' (T_VARIABLE) in
Please check the commas, semicolons from the previous lines which may not be present

: mysqli_query() expects parameter 1 to be mysqli, null given in
Please check on the MySQLi connection, whether the variable '$con' has the correct spelling or not

Notice : Undefined variable: ... in .... on line ...
Please check on the variable declared on the line indicated, whether it was undefined earlier or there maybe duplication on the usage of the variable

Warning : mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in in .... on line ...
Please check on the table or field name where the result is intended to be stored

Notice: Undefined index: ... in ... on line ...
Please check on the field name whether it exists or not in table