OK, that's pretty much what I thought it meant....and I tried to print out $conn but got nothing so I think you must be right that $conn hasn't been set up.
The code is inside a function which is called from a PHP page. Both the page and the function library contain various included/required files. I'll try to represent this as best as I can.
ucp.php
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
require($_SERVER["DOCUMENT_ROOT"] . '/configcs.' . $phpEx);
require($_SERVER["DOCUMENT_ROOT"] . '/functioncs.' . $phpEx);
.....
login_box(request_var('redirect', "index.$phpEx"));
functions.php (included by common.php)
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
{
$username_cs = mysql_real_escape_string($_REQUEST[username]);
$password_cs = mysql_real_escape_string($_REQUEST[password]);
//print_r($conn);
$sql="SELECT * from thetable WHERE myuserid='$username_cs'";
$rs=$conn->execute($sql);
}
So, where is $conn set up....
inside /configcs.php
$conn = &ADONewConnection($DBTYPE);
$conn->PConnect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME);
My only thought here is that maybe /configcs.php isn't being pulled in. How can I test this?