You are here: Re: retrieving table comment from mysql database « All PHP « IT news, forums, messages
Re: retrieving table comment from mysql database

Posted by windandwaves on 07/11/05 13:09

windandwaves wrote:
> Hi Gurus
>
> Is there a way to retrieve the table comment from a mysql table.
>
> In PHP My Admin, you can set the comment for a table. however, I was
> wondering if you can retrieve it for use in a PHP page.
>
> Any help greatly appreciated.
>
> - Nicolaas

This is the function I made up (I only use one space as indent):

function table_description($t) {
$sql = 'SHOW CREATE TABLE `'.$t.'`;';
$query = mysql_query($sql);
$v = mysql_result($query, 0, 1);
if($v) {
$p = strpos($v,"COMMENT=");
if($p) {
return substr($v, $p + 8);
}
}
return 'Table description not found';
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация