#24697 [Opn->Fbk]: odbc can not return accurate result when we handle excel file use odbc

From: Date: Fri, 18 Jul 2003 03:47:41 +0000
Subject: #24697 [Opn->Fbk]: odbc can not return accurate result when we handle excel file use odbc
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-44223@lists.php.net to get a copy of this message
 ID:               24697
 Updated by:       kalowsky@php.net
 Reported By:      tty3000 at hotmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         ODBC related
 Operating System: win 2000
 PHP Version:      4.3.2
 New Comment:

I'm not quite sure I follow the bug you're reporting here.  Can you
(with another ODBC application) get the results you're expecting?  I
don't see how a query like that can fail as it's upto the logic of the
backing DB and not PHP to return the result set.


Previous Comments:
------------------------------------------------------------------------

[2003-07-17 20:50:59] tty3000 at hotmail dot com

Description:
------------
odbc can not return accurate result when we handle excel file use
odbc.
In excel file,we handle "NUMBER" nor "VARCHAR" ,this question appear.
  we find ,this question appear when "0878-13420987" or
"0878_13420987".

Reproduce code:
---------------
 	$user = '';
	$pass = '';
	$host = 'customerxls';
	$phptype='odbc';
	//database name in excel
file£º[main],[con_data],[con_person],[detail_data]
	$dsn = "$phptype://$user:$pass@$host";
$type=main;
	$connection=@odbc_connect($host,"","");
			$query="select a,b,d from $type";
				
				$result=@odbc_do($connection,$query);


		
    				$query_count="select count(*) from $type";  

	echo "<br>".$query."<br>";
	


	$col=count($title_array);
	for($i=0;$i<$col;$i++)
		echo $title_array[$i]."\t";
	echo "<br>"; 

	while (@odbc_fetch_row($result)){  
		echo
odbc_result($result,a)."<---->".odbc_result($result,b)."<---->".odbc_result($result,y)."<br>";
		//echo $row[0]."<br>";
		
	}

 
    

Expected result:
----------------
1.0<---->China<---->3395
2.0<---->China<---->13308
2.0<---->China<---->


Actual result:
--------------
1.0<---->China<---->3395
2.0<---->China<---->13308
3.0<---->China<---->



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24697&edit=1



Thread (3 messages)

« previous php.bugs (#44223) next »