php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10568 error using ODBC
Submitted: 2001-04-30 18:37 UTC Modified: 2001-05-28 00:19 UTC
From: hpincheira at fasa dot cl Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.4pl1 OS: Win 98
Private report: No CVE-ID: None
 [2001-04-30 18:37 UTC] hpincheira at fasa dot cl
Hello:  
  
I am using a database called " RECITAL ".  I am trying to connect myself using ODBC.  When executing the command: odbc_exec($connect, $query) I can revise the connection from the database and indeed her ago.  But then treatment of consenting to the data using any function ODBC, for example:   
--------------------------------  
odbc_result_all($connect, BGCOLOR = ' #AAFFAA ' border=3 width=30% bordercolordark = ' #FF0000 '");  
-------------------------------  
  
  
 and it throws me this error:  
  
---------------------------------  
Warning: Not tuples available at this result index in programa/apache c:/archivos group/apache/htdocs/b.html on line 7  
---------------------------------  
  
I need to know if they can help me with this.  
  
thank you.  
  
  
(the table if it exists, some fields is: nlocal,ncontr)  
  
This is the program php:  
---------------------------------------  
<?php  
  function to () {   
$connect = odbc_connect (" dig ", " root ", cir0921, " SQL_CUR_USE_ODBC ");   
$query = SELECT * local FROM";   
$result = odbc_exec($connect, $query);   
  
while(odbc_fetch_row($result)) {   
$id=odbc_result($result,1);   
$pass=odbc_result($result,2);   
 echo id:$id,pass:$pass   
";   
}   
  
  
odbc_close_all($connect);   
return true;   
} / / a  
  
?>  
     
<?php   
	echo"Lines Before";   
        $bb = a();  
           echo " Lines Later";  
?>  
  
  
---------------------------------------

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-01 09:59 UTC] kalowsky@php.net
i'm not sure i understand the error you're receiving.  can you please give a sample script that creates the error?

also, are you sure your SELECT statement works properly?
 [2001-05-02 08:58 UTC] hpincheira at fasa dot cl
(I?am using a traductor English/Spanish)


I use the software ?Microsoft Query? for test the DNS connection and it worked very well, but when I try to enter through php it throws me the mentioned error and not you that it is.
 


This is a script:

<?php  
function a() {   
$connect = odbc_connect (? dig ?, ? root ?, cir0921, ? SQL_CUR_USE_ODBC ?);   
$query = SELECT * FROM local?;   
$result = odbc_exec($connect, $query);   
  
while(odbc_fetch_row($result)) {   
$id=odbc_result($result,1);   
$pass=odbc_result($result,2);   
echo id:$id,pass:$pass   
?;   
}   
  
  
odbc_close_all($connect);   
return true;   
} / / a  
  
?>  
     
<?php   
echo?Lines Before?;   
$bb = a();  
echo ? Lines Later?;  
?>  
  

 [2001-05-07 10:58 UTC] kalowsky@php.net
the SQL_CUR_USE_ODBC does not require quotes, try that first.

second PHP 4.0.5 is out, do please see if this continues there.  and third have you tried checking to make sure your db connection exists?  it seems you do the odbc_connect and never check the result.
 [2001-05-28 00:19 UTC] kalowsky@php.net
no user feedback, considered fixed in cvs
 [2002-11-03 17:49 UTC] ganeshr at ee dot tamu dot edu
I get the same warning. I basically select rows from a table and insert into another table. There are three rows that satisfy the select query and it inserts only one row and throws that warning. I use php4.2.3 on windows 2000 and it connects to MS-ACCESS database.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 01 21:01:32 2024 UTC