Cant see Views

Issue #40 resolved
Former user created an issue

Originally reported on Google Code with ID 40 ``` I cannot see any Views in the sqlite database it will be useful if you have display of view.

```

Reported by `nl.mahesh` on 2011-06-10 17:16:51

Comments (5)

  1. Former user Account Deleted

    ``` I added this code in my server to see Views (line 1660 in my phpliteadmin v1.8.6, but you can search 'echo "No tables in database.";' and place this code after it:

    Display list of view echo "<br/>"; $query = "SELECT name FROM sqlite_master WHERE type='view' ORDER BY name"; $result = $db->selectArray($query); $j=0; for($i=0; $i<sizeof($result); $i++) { echo $result[$i]['name']."<br/>"; $j++; if(substr($result[$i]['name'], 0, 7)!="sqlite_" && $result[$i]['name']!="") { echo "<a href='".PAGE."?action=row_view&table=".$result[$i]['name']."'"; if(isset($_GET['table']) && $_GET['table']==$result[$i]['name']) echo " style='text-decoration:underline;'"; echo ">".$result[$i]['name']."</a><br/>"; $j++; } } if($j==0) echo "No views in database.";

    With this the Views are used as Tables in phpliteadmin so you can browse datas and filter it. You cannot manage the view in this way, you need to use the SQL panel. Nor you can export or import views until a more complete and complex implementation.

    You can have the same result modifying the table list by adding views: Modify this code: Display list of tables $query = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name";

    to:

    Display list of tables and views $query = "SELECT name FROM sqlite_master WHERE type='table' OR type='view' ORDER BY type, name";

    Is not the right way, but waiting a correct View implementation in phpliteadmin this help me. ```

    Reported by `fabrizio.conti.italy` on 2011-06-14 09:22:34

  2. Razvan Popescu

    ``` Here's a patch against 1.8.6, which fixes the issue above. In more detail, it: - defines a global query used everywhere tables are listed - includes the views in the table listings - removes the duplicated query found in several places, and uses the constant above - removes the need to filter on sqlite_ prefixed tables, by including the filter in the SQL query - correctly lists the total number of tables (previously all sqlite_ prefixed tables were counted, as a result of using sizeof($result));

    Cheers, Radu ```

    Reported by `rpopescu` on 2011-07-10 09:07:29

    <hr>

  3. Dane Iracleous

    ``` v1.9.0 will have views implemented ```

    Reported by `diracleo` on 2011-10-29 13:36:20 - Status changed: `Fixed`

  4. Log in to comment