php - Issues with returning Array from Connection Class -



php - Issues with returning Array from Connection Class -

i having issue returning array.

this part of connection class.

public function createdataset($incomingsql) { $this->stmt = sqlsrv_query($this->conn, $incomingsql); if ($this->stmt) { $this->rows = sqlsrv_has_rows($this->stmt); if ($this->rows) { while($this->row = sqlsrv_fetch_array($this->stmt, sqlsrv_fetch_numeric)) { $this->myarray[] = $this->row; } } homecoming $this->myarray; //$this->result = $this->row; //return $this->result; } }

and how calling on page...

$conn3 = new connectionclass; $mydataset = $conn3->createdataset('select top (100) city, state, postalcode store'); echo $mydataset[0];

i using echo test.

the $mydataset echoing nothing. can see $myarray fill 100 records when debug, not homecoming it..

php oop

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -