我正在尝试连接mysql数据库到一个表,我有一个php文件。我将测试服务器设置为在以下位置查找服务器文件夹
H:\PHP\htdocs\EDMuncovered\和中的Web URL
http://localhost/EDMuncovered/我也设置了一个‘成功连接’的数据库,但当我在DreamWeaver的实时视图中查看我的页面时,它显示了以下内容:
Fatal error: Can't use function return value in write context in H:\PHP\htdocs\EDMuncovered\PHP\htdocs\EDMuncovered\TMPqntvw2.php on line 36当在我的浏览器中打开时,它只是在代码视图中读取以DreamWeaver编写的文件,没有任何样式或基础知识,只有代码。
我已经查看了该文件的第36行,以查看是否知道是什么导致了问题,但以下是以下内容,据我所知,我不知道如何更正才能使其正常工作:
$edmuncovered = mysql_query($query_edmuncovered, $edmuncovered) or die(mysql_error());出于某种原因,每次我尝试在实时视图中查看时,它都会自动在我的服务器文件夹中创建一个单独的子文件夹,该子文件夹的名称和路径与您上面看到的完全相同,然后它会在其中转储一个TMP文件,这是我的文件的完全副本。我不知道为什么,我觉得这就是问题所在,但无论我做了什么修改,它每次都会产生问题。
有什么想法吗?
编辑::这里是错误引用的代码行(36)之前和之后的几行;
<?php require_once('../../../Connections/edmuncovered.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;
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_edmuncovered, $edmuncovered);
$query_edmuncovered = "SELECT * FROM news";
$edmuncovered = mysql_query($query_edmuncovered, $edmuncovered) or die(mysql_error());
$row_edmuncovered = mysql_fetch_assoc($edmuncovered);
$totalRows_edmuncovered = mysql_num_rows($edmuncovered);
?>发布于 2013-05-02 09:17:50
你不应该把你的htdocs放到你的XAMPP文件夹中吗?
https://stackoverflow.com/questions/16328796
复制相似问题