Re: odbc_exec() act funny.....
| From: | Scott Fletcher | Date: | Tue, 15 Oct 2002 19:07:00 +0000 |
| Subject: | Re: odbc_exec() act funny..... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120061@lists.php.net to get a copy of this message | ||
--------clip--------
$database = "ECBI_DB";
$user = "db2inst1";
$pass = "ibmdb2";
$cid = @odbc_connect($database,$user,$pass) or die("Unable to connect to
Database !!!") ;
$ask = "SELECT * FROM CUSTOMERS, USERS ";
$ask .= "WHERE CUSTOMERS.CUSTOMER_ID =
'".$_POST['Customer_Id']."' AND ";
$ask .= "USERS.USER_LOGON1 = '".$User_Logon1."' AND ";
$ask .= "USERS.USER_PASS1 = '".$User_Pass1."' ";
$result=odbc_exec($cid,$ask);
$workaround_fix = 0;
if (odbc_fetch_row($result,++$workaround_fix))
{
$USER_ID = odbc_result($result,USER_ID);
$ECBI_ACCESS = odbc_result($result,ECBI_ACCESS);
$COMPANY_STATUS = odbc_result($result,COMPANY_STATUS);
$TIME_START = odbc_result($result,TIME_START);
$TIME_END = odbc_result($result,TIME_END);
$LOGIN_COUNT = odbc_result($result,LOGIN_COUNT);
}
else $login_status="FAIL";
--------clip--------
Instead of odbc_fetch_row, the other odbc function does the same thing.
--------clip--------
odbc_result_all($result,"class='form' border='2' cellpading='0'
cellspacing='0' bordercolor='#C64839'");
--------clip--------
However, odbc_exec() work great with these two, 1) odbc_num_rows, 2)
odbc_num_fields.
"Jay Blanchard" <jay.blanchard@niicommunications.com> wrote in message
news:000901c2747b$ccaffc00$8102a8c0@000347D72515...
> [snip]
> With odbc_exec() function, it is able to execute and retrieve the data
> pretty well. Unfortunately, when the number of fields grow and grow then
> the odbc_exec() return false and a blank data. I don't get it! When I
run
> the SQL command through the database interface, it work like a charm. So,
> it is a PHP issue.
>
> Is it a PHP bug? What's up with that?????
> [/snip]
>
> Can we see the code involved?
>
> Jay
>