PHP从数据库中获取SQL数据

时间:2014-10-05 12:55:19

标签: php mysql sql sql-server

嘿我想要从数据库中检索一些数据。但似乎每当我将我的凭据输入SQL数据库以检索数据时,我都会收到以下错误:

1 个答案:

答案 0 :(得分:1)

因为我认为这是与last question

类似的用例

您的php文件缺少连接配置:

<?php
$dbuser = "******"; 
$dbpass = "*******"; 
$db = "SSID";
$connect = OCILogon($dbuser, $dbpass, $db);



if (!$connect) {
echo "An error occurred connecting to the database";
exit;
}

因此它知道您正在使用哪个连接并传递给checkUserPass()函数。

<强>更新

对于表名,您需要传递$ dbtable,如函数声明中所示

  

function checkUserPass($ connect,$ username,$ password, $ dbtable

所以要么在调用函数之前设置$ dbtable变量:

  

$ DBTABLE = “register_table”;

或立即将其作为字符串发送:

  

function checkUserPass($ connect,$ username,$ password,“register_table”

相关问题