Re: PHP/mysql equivalent of PEAR's tableInfo()??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 11, 2009 at 19:57, Govinda<govinda.webdnatalk@xxxxxxxxx> wrote:
> I have been using PEAR's tableInfo() to remind myself about the columns in
> the table..  but now I want to see as much data as possible about the table
> and its contents *without* using PEAR.   (I.e. just using built in stuff for
> mysqli.)

    This is not mysqli_#() directly, but just mocked up here in this
email.  Not guaranteed to work, but should give you the right idea at
least.  ;-P

<?php
include('inc/config.php'); // Your configuration
include('inc/db.php'); // Your database connection info

$sql = "SHOW TABLES";

$result = mysql_query($sql);

foreach(mysql_fetch_assoc($result) as $k => $v) {
        $ssql = "DESCRIBE ".mysql_real_escape_string($v);
        $rresult = mysql_query($ssql);
        echo "<b>".$k."</b>:<br />\n";
        echo "<pre>\n";
        print_r(mysql_fetch_assoc($rresult));
        echo "</pre>\n";
        echo "<br />\n";
}
?>


-- 
</Daniel P. Brown>
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux