Php always reports an error. could you help me check the code ;? Phprequire_once ('../Connections/test. php ');? & Gt; & lt ;? Phpif (! Function_exists (& quot; GetSQLValueString & quot;) {functionGetSQLVa php always reports an error. let me check the code.
If (! Function_exists ("GetSQLValueString ")){
Function GetSQLValueString ($ theValue, $ theType, $ theDefinedValue = "", $ theNotDefinedValue = "")
{
If (PHP_VERSION <6 ){
$ TheValue = get_magic_quotes_gpc ()? Stripslashes ($ theValue): $ theValue;
}
$ TheValue = function_exists ("mysql_real_escape_string ")? Mysql_real_escape_string ($ theValue): mysql_escape_string ($ theValue );
Switch ($ theType ){
Case "text ":
$ TheValue = ($ theValue! = "")? "'". $ TheValue. "'": "NULL ";
Break;
Case "long ":
Case "int ":
$ TheValue = ($ theValue! = "")? Intval ($ theValue): "NULL ";
Break;
Case "double ":
$ TheValue = ($ theValue! = "")? Doubleval ($ theValue): "NULL ";
Break;
Case "date ":
$ TheValue = ($ theValue! = "")? "'". $ TheValue. "'": "NULL ";
Break;
Case "defined ":
$ TheValue = ($ theValue! = "")? $ TheDefinedValue: $ theNotDefinedValue;
Break;
}
Return $ theValue;
}
}
Mysql_select_db ($ database_test, $ test );
$ Query_test = "SELECT * FROM test ";
$ Test = mysql_query ($ query_test, $ test) or die (mysql_error ());
$ Row_test = mysql_fetch_assoc ($ test );
$ TotalRows_test = mysql_num_rows ($ test );
?>
| Id |
Name |
Pass |
While ($ row1 = mysql_fetch_array ($ result1 )){$ Id = trim ($ row1 [id]);$ Name = trim ($ row1 [name]);$ Pass = trim ($ row1 [pass]);Echo"
| $ Id |
$ Name |
$ Pass |
";}?>
Mysql_free_result ($ test );
?> [Code = PHP] [/code]
==================================
Error:
Notice: Use of undefined constant id-assumed 'id' in D: \ xampp \ htdocs \ vest \ index. php on line 68
Notice: Use of undefined constant name-assumed 'name' in D: \ xampp \ htdocs \ vest \ index. php on line 69
Notice: Use of undefined constant pass-assumed 'pass' in D: \ xampp \ htdocs \ vest \ index. php on line 70
Rows 68, 69, and 70 are