• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

php 搞代码 3年前 (2022-01-23) 18次浏览 已收录 0个评论

php总是报错,大家帮我看下代码
<?php require_once(‘../Connections/test.php’); ?>
<?php
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;
(本文来)源gaodaimacom搞#^代%!码&网(

搞gaodaima代码

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 < 3 order by id ASC ");
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

<?php
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这三行是


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php总是报错,大家帮小弟我看下代码

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址