执行 ADO 方法不起作用


execute ado method not working

好的,你好伙计们,我在这里的第一篇文章,我有点绝望(对不起,如果我的英语不好,不是我的主要语言),无论如何,我正在使用 ADOdb 制作一个 IS,使用 PHP 和 Postgresql,现在我的系统在 php 版本 5.2.5 上运行良好,我从 github 中提取我的代码,进入我的笔记本电脑,并安装了最新版本的 php, $conn->Execute方法不起作用(耶),尝试降级php版本(wampserver)仍然不起作用,我说"嘿,如果不是php版本,我会疯了,升级我主计算机中的那个:D"长话短说,我搞砸了,现在代码在我的任何计算机中都不起作用(再次讽刺耶),问题是执行没有执行>.<...所以这是我的代码,请帮忙,我没有看到问题...真的(我没有碰过数据库或代码,只是 wamp 服务器......

函数loguear_coord($usuario,$contrase ña,$conn){ $contrase ña=sha1(md5($contrase ña));    $query="从用户中选择 *,其中 ((usuario 喜欢 '%$usuario%') 和 (传递像 '%$contrase ña%'))";    $result=$conn->执行($query);    if($result==false)    {        echo "error al insertar: ".$conn->ErrorMsg()."
" ; } 还 { 而(!$result->EOF) { for ($i=0, $max=$result->FieldCount(); $i <$max; $i++) { $usuario 2=$result->字段[5]; $nivel=$result->字段[2]; if($usuario == $result->字段[5]) { $id=2; /aquí hacer lo de la variable de sesion/ session_start(); $_SESSION['nivel']=$nivel; $_SESSION['usuario']=$usuario; $prueba 1="超过九千"; $prueba 1=SHA1(md5($prueba 1));
$_SESSION['班德拉']=$prueba 1;
            }
        }               
        $result->MoveNext();                            
    }
    if($id==2)
        {                           
            header("location: ../coordinacion_principal.php"); 
        }
        else
        {       
            $id=1;
            header("location: ../index.php?id=$id");                
        }
}
$conn->Close();

}

调用函数的情况就是

这种情况 case 'Accesar':/*loguear en la coordinación*/ if(isset($_POST['usuario']) && isset($_POST['contraseña'])) { $usuario = $_POST['usuario']; $contraseña = $_POST['contraseña']; //var_dump($conn); loguear_coord($usuario,$contraseña,$conn); } /*and this is my conection to the database, that remember worked 'till yesterday*/ include('adodb5/adodb.inc.php'); $conn = ADONewConnection('postgres'); $conn->PConnect('host=localhost port=5432 dbname=Tesis user=postgres password=gamn2090'); if (!$conn) { echo "Error en la conexion.'n"; } $conn2 = ADONewConnection('postgres'); $conn2->PConnect('host=localhost port=5432 dbname=Control_de_estudios user=postgres password=gamn2090'); if (!$conn2) { echo "Error en la conexion.'n"; }

它工作'直到$conn->执行($query); 行 u.u 请帮助

好吧,我终于解决了! 它是来自 WAMP 服务器的 PHP 版本,工作的 WAMP 版本是 1.7.4,PHP 版本是 5.2.5,问题是在 PHP 设置和 PHP 扩展中我没有选择PDO_pgsql和 pgsql,并且它没有重新识别数据库, 我发布这个,希望它能帮助一些比我有同样问题的可怜灵魂:)