Bug #15900 Updated: arguments to functions or again ODBC bug.
| From: | kalowsky@php.net | Date: | Mon, 24 Jun 2002 21:10:17 +0000 |
| Subject: | Bug #15900 Updated: arguments to functions or again ODBC bug. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11971@lists.php.net to get a copy of this message | ||
ID: 15900
Updated by: kalowsky@php.net
Reported By: adasi@grubno.da.ru
-Status: Open
+Status: Closed
Bug Type: ODBC related
Operating System: Linux
PHP Version: 4.1.2
New Comment:
Unable to reproduce any error with either of these versions. If $kid
is not being passed in as a variable through your function, that isn't
a problem of the ODBC system. Please add a print debug and see what
your SQL query looks like before you execute it.
Previous Comments:
------------------------------------------------------------------------
[2002-03-06 13:33:25] adasi@grubno.da.ru
Also:
echo odbc_result($table,5);
works but
$tname=odbc_result($table,5); echo $tname;
shows nothing.... dunno what to do, it's urgent.
unixODBC-2.2.1
FreeTDS-0.53
------------------------------------------------------------------------
[2002-03-06 10:13:25] adasi@grubno.da.ru
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] adasi@grubno.da.ru
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