PHP always error, everyone help me to read 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 ($row 1=mysql_fetch_array ($result 1)) {$id =trim ($row 1[id]), $name =trim ($row 1[name]), $pass =trim ($row 1[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
68, 69, 70 these three lines are