  | 
              
	              
	                
  
    
	 
        ติดปัญหาเรื่อง Code Connect Progress DB(Syteline DB) โดย ODBC สามารถ Connect ได้ปรกติ     | 
   
  
    |   | 
   
 
 
 
	
		
			  | 
	   | 
	    | 
		
			  | 
	 
	
		
			  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                ผมติดปัญหาในการ Connect ODBC Progress DB ครับ ใน ODBC สามารถ Connect ได้ตามปรกติ แต่ใช้ Code ในการ Connect ไม่ได้่ครับพี่ ๆ รบกวนดู Code ให้หน่อยครับว่าผิดตรงไหน 
 
Code ในการ Connect 
 
Code (PHP) 
<?PHP
$dns="LiveBKI";
$host="111.11.111.11"; // IP ตัวอย่าง
$dbname="bki";
$user="";
$pass="";
if($conn_id=odbc_connect($dns,$user,$pass, SQL_CUR_USE_ODBC )){
echo " connected to DSN: sports91b ";
if($cur=odbc_exec($conn_id, "SELECT * FROM PUB.Item")) {
$Fields = odbc_num_fields($cur);
print "<=table border='1' width='100%'> <=tr>'";
// Build Column Headers
for ($i=1; $i <= $Fields; $i++){
printf("<=th bgcolor='silver'>%s <=/th>", odbc_field_name( $cur,$i)); }
// Table Body
$Outer=0;
while( odbc_fetch_row( $cur )){
$Outer++;
print "<=tr>";
for($i=1; $i <= $Fields; $i++){
printf("<=td>%s<=/td>", odbc_result( $cur, $i ));
}
print "<=/tr>";
}
print "<=/table>";
print " Your request returned $Outer rows!";
}
odbc_close( $conn_id);
}
?>
 
 
ภาพการ Connect ODBC 
 
 
 
 
  Tag : PHP, HTML/CSS, Windows               
                        | 
           
          
            
		
  ประวัติการแก้ไข 2013-12-19 17:09:13	
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2013-12-19 10:12:53 | 
                      By :
                          TotEcom | 
                      View :
                          964 | 
                      Reply :
                          2 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  | 
	 
	
		
			  | 
		  | 
		
			  | 
		
			  | 
	 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 มี Error หรือเปล่าครับ ว่าแต่ทำไมไม่ใช้ pg ล่ะครับ 
 
Code (PHP) 
<?php
$conn_string = "host=localhost port=5432 dbname=lis user=postgres password=postgres";
$dbconn = pg_connect($conn_string);
$sql = "SELECT *  FROM layer.geograp ORDER BY geo_id ASC";
$query_result	= pg_query($dbconn,$sql);
$num = pg_numrows($query_result);
<?php $i=0; while ($i < $num) {
?>
<?php echo pg_result($query_result,$i,"geo_name");?>
<?php $i++;  }
?>
                        
               
               | 
             
            
              
			  			  
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-12-20 09:00:36 | 
                        By :
                            mr.win | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 Error นี้ครับพี่ Win ควรแก้ปัญหายังไงดีครับ 
 
                         
               
               | 
             
            
              
			                
  ประวัติการแก้ไข 2013-12-20 13:10:01              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-12-20 10:44:36 | 
                        By :
                            TotEcom | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |