Re: Get Names of tables in mysql

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

 



<?php
$result = mysql_query("SHOW COLUMNS FROM sometable");
if (!$result) {
     echo 'Could not run query: ' . mysql_error();
     exit;
}
if (mysql_num_rows($result) > 0) {
     while ($row = mysql_fetch_assoc($result)) {
         print_r($row);
     }
}
?>

--
Joe


On Sep 3, 2008, at 12:32 PM, Jean Carlo wrote:

> How can I get the field names from a specified MySQL table?
>
> I don't need the data, I just want to get the tables field names.
>
>
> 



[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux