• (2 Pages)
  • +
  • 1
  • 2

Setting up a PHP web service to be consumed by VB.NET Rate Topic: -----

#16 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14552
  • View blog
  • Posts: 58,359
  • Joined: 12-June 08

Posted 24 February 2018 - 11:27 PM

No idea.. I don't know the exact error message text or the code you are using.
Was This Post Helpful? 0
  • +
  • -

#17 shyampatil   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 21-February 18

Posted 27 February 2018 - 06:03 AM

Quote

@maxine2013
 function Get_Test_Data($sql) 
    {
	
	
$cn  = pg_connect("host='my ip' port='5432' dbname='db' user='postgres' password=");
	

	$rs = pg_query($cn,$sql);
	$nm = pg_num_rows($rs);
	$oReturn[$nm];
	$ctr = 0;
	
	while ($line = pg_fetch_array($rs,null, PGSQL_ASSOC)) 
				{
				
					$oReturn[$ctr] = array('state_code'=>$line['state_code'], 'county_name'=>$line['county_name'] , 'fipscode'=>$line['fipscode']);
		
					$ctr = $ctr+1;
					
				}
				
pg_close(cn);

			
      return $oReturn;
    }



When I tried to manually input a array. its okay. but when connecting to database its getting me and error.





How you pass $sql variabale to Get_Test_Data() function

This post has been edited by modi123_1: 27 February 2018 - 07:51 AM
Reason for edit:: Fixed botched code/quote tags

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2