ID: 15900 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open -Bug Type: *General Issues +Bug Type: ODBC related Operating System: Linux PHP Version: 4.1.2
Previous Comments: ------------------------------------------------------------------------ [2002-03-06 10:13:25] [EMAIL PROTECTED] In second first example i've cut lines with my example database name, user and password. In second one i forgot to do it. Of course the reason why it's not working is '$a=$kid;', not the database name/user/pass definitions. ------------------------------------------------------------------------ [2002-03-06 10:09:59] [EMAIL PROTECTED] This function: function GetTID($kid) { $a=$kid; $conn = odbc_pconnect("$database", "$username", "$password"); $query = "select * from KontrahIO where KontrId2 = ".$kid; $table = odbc_do($conn,$query); $xi=1; odbc_fetch_row($table); while (odbc_fetch_row($table)) { $tid[$xi]=odbc_result($table,9); $a=$tid[$xi]; $xi++; } odbc_close($conn); return $tid; } works but this one: function GetTID($kid) { $database="Hetman"; $username="admin"; $password="pewnienie"; $conn = odbc_pconnect("$database", "$username", "$password"); $query = "select * from KontrahIO where KontrId2 = ".$kid; $table = odbc_do($conn,$query); $xi=1; odbc_fetch_row($table); while (odbc_fetch_row($table)) { $tid[$xi]=odbc_result($table,9); $a=$tid[$xi]; $xi++; } odbc_close($conn); return $tid; } no... It's returning nothing ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15900&edit=1