1

In mysql class I have this method to print list of columns

public function printMemberColumns(){
  $n=-1;
  foreach (explode(',',CONFIG::tables) as $tab):
    $n++;
    $result = mysql_query( "SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_NAME`='$tab' AND `TABLE_SCHEMA`='".MYSQL::BASE."'");    
    while ( $data = mysql_fetch_row($result) )
      echo $data[0];
  endforeach;
  }

How to change it to do it using sqlite?

I would expect something like this but it says these tables do not exist:

public function printMemberColumns(){
  $n=-1;
  foreach (explode(',',CONFIG::tables) as $tab):
    $n++;
    $result = sqlite_query( $this->handle, "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='$tab' AND TABLE_SCHEMA='".SQLITE::BASE."'");    
    while ( $data = sqlite_fetch_array($result) )
      echo $data[0];
  endforeach;
  }

I am not using PDO and I am using PHP 5.2.0

CL.
  • 173,858
  • 17
  • 217
  • 259
John Boe
  • 3,501
  • 10
  • 37
  • 71
  • 1
    PHP 5.2.0 was [released almost ten years ago](http://php.net/ChangeLog-5.php#5.2.0). There have been countless security fixes since then. I would strongly urge you to upgrade to the latest release. – timclutton Apr 27 '16 at 09:45

0 Answers0