试了,没用...
apache2+php5.02+mysql5.01
是不是配置的问题?
apache2+php5.02+mysql5.01
是不是配置的问题?
解决方案 »
- 这段时间,我和正则表达式干上了,希望和各位老大一起干掉它!
- ajax实现phpwind中添加好友功能
- php中的数据类型转换问题
- 弱弱的一问:PHP里有没一个全局变量或函数是获取地址的?
- 在请教:我在用fopen获取WEB页面的内容时……
- 请大家告诉我php中如何实现com编程,替我顶!!!
- 哪里有好的php+mysql的主页空间申请,要求带域名申请,要好一些,且不太贵的??
- call_user_func_array传参问题
- 高手请进,无数高手完全弄不懂的编码问题.神奇的乱码
- 请问mysql查询语句为什么总是抛异常,实际操作已经成功,数据库可以看到结果
- MYSQL问题,如果同表复制记录?在线等
- 这个查询没有思路了
true or false,还是0 or 1?
->
if ($res != "2")
2、给出moveTo方法的代码
if ($res)
{
$res = 3;
if ($res != 2)
alert("移动成功", "redirect", $_SERVER['PHP_SELF']);
else
alert("不能将分类添加到其子分类中.", "back");
}
显示移动成功
---------------------
2.moveTo 代码
function moveTo($fromAbsPath, $toAbsPath)
{
//根据节点绝对路径取出catPath
if (strpos($toAbsPath, $fromAbsPath) === false)
{
$fromCatPath = $this->getCatPath($fromAbsPath);
$fromCatID = $this->getCatID($fromAbsPath);
$sql = "UPDATE {$this->tblName}
SET catPath = REPLACE(catPath, '$fromCatPath', '$toAbsPath')
WHERE catID = $fromCatID OR catPath LIKE '$fromAbsPath%'";
//echo $sql;
return $this->db->query($sql);
}
else
return 2;
}
节点移动成功时能显示sql语句
但还是弹出"不能将分类添加到其子分类中",郁闷。
{
//根据节点绝对路径取出catPath
if (strpos($toAbsPath, $fromAbsPath) === false)
{
$fromCatPath = $this->getCatPath($fromAbsPath);
$fromCatID = $this->getCatID($fromAbsPath);
$sql = "UPDATE {$this->tblName}
SET catPath = REPLACE(catPath, '$fromCatPath', '$toAbsPath')
WHERE catID = $fromCatID OR catPath LIKE '$fromAbsPath%'";
if($this->db->query($sql))
return 3;
}
return 2;
}
请检查db->query($sql);的返回值,通常返回的是逻辑值或被影响的记录数
但你的db类是作为部件嵌入在类中的,所以类的方法的返回值不应该直接使用他的返回值
if($this->db->query($sql))
return 1;
else
return 0;
检查de->query($sql)的返回值为bool是1---------------------------------------------
但你的db类是作为部件嵌入在类中的,所以类的方法的返回值不应该直接使用他的返回值
这是为什么呢?
<?php
$res = 2>1; //$res 为 true
echo "\$res的值为 $res<br>";
if($res != 2)
echo "$res != 2";
else
echo "$res == 2";
?>
//echo $sql;
return $this->db->query($sql);
}
else
return false;
}把判断程序改为
if ($res)
alert("移动成功", "redirect", $_SERVER['PHP_SELF']); else
alert("不能将分类添加到其子分类中.", "back");