Jump to content

PHPUser322

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PHPUser322's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I am creating a class which contains one private function that deals with connecting to a SQL Server and executing the sql that is passed in to that function. I have defined a class variable which is assigned the value of sqlsrv_query like so. $this->QueryResult = sqlsrv_query($conn,$sql); I have placed private $QueryResult at the top of my class. The other public methods call this private function to assign the result set to the class variable, the private method returns and then the public methods loop through the results array like so. while($row = sqlsrv_fetch_array($this->QueryResult)) .. but the while loop never gets entered. If I declare everything in the same method then it works, however there are going to be several public methods that will use this private method and I don't want to duplicate all the database coding. Hope someone can help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.