Reply to Re: retrieving table comment from mysql database

Your name:

Reply:


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';
}

[Back to original 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

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