欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php总是报错,大家帮小弟我看下代码

程序员文章站 2022-05-13 17:12:20
...
php总是报错,大家帮我看下代码

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION $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);
?>

























$result1 = mysql_query("SELECT * FROM test where id while($row1=mysql_fetch_array($result1))
{
$id=trim($row1[id]);
$name=trim($row1[name]);
$pass=trim($row1[pass]);
echo
"





";
}

?>
id name pass
$id $name $pass


mysql_free_result($test);
?>[code=PHP][/code]
=============================
报错:
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这三行是
php总是报错,大家帮小弟我看下代码

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频