Welcome Guest, Not a member yet? Register   Sign In
Query for Show Tables?
#2

[eluser]KingSkippus[/eluser]
If your database name is, say, blogdb, you can loop through like this:

Code:
$this->load->database();
$sql = 'show tables';
$sth = $this->db->query("SHOW TABLES LIKE 'fred%'");
foreach ($sth->result_array() as $row) {
  echo htmlentities($row['Tables_in_blogdb'])."<br />\n";
}


Messages In This Thread
Query for Show Tables? - by El Forum - 07-21-2010, 06:50 PM
Query for Show Tables? - by El Forum - 07-21-2010, 09:56 PM
Query for Show Tables? - by El Forum - 07-22-2010, 02:54 PM
Query for Show Tables? - by El Forum - 07-22-2010, 03:06 PM
Query for Show Tables? - by El Forum - 07-22-2010, 03:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB