Home  |  Linux  | Mysql  | PHP  | XML
From:Phansys Corp Date:Sat Aug 28 19:57:05 2010
Subject:Re: Need Help with database output
Hi Nagendra!

<?php

///...require to $link_resource mysql

$query = 'SELECT Col1, Col2, Col3 FROM table';
$rs_query = mysql_query($query, $link_resource);
$row_rs_query = mysql_fetch_assoc($rs_query);
$total_row_rs_query = mysql_num_rows($rs_query);

if ($total_row_rs_query > 0) {
echo
'<table><thead><tr><th>Col1</th><th>Col2</th><th>Col3</th></tr></thead>';
do {
echo '<tr><td>', $row_rs_query['Col1'], '</td><td>', $row_rs_query['Col2'],
'</td><td>', $row_rs_query['Col3'], '</td></tr>';
} while($row_rs_query = mysql_fetch_assoc($rs_query));
echo '</table>';
}
mysql_free_result($rs_query);

?>

2010/8/28 nagendra prasad <nagendra802000@gmail.com>

> Hi All,
>
> I have a database and I want to show it in 3 columns Like
>
> Col1 Col2 Col3
> data1 data2 data3
> data4 data5 data5
> ........ ....... ........
>
>
> I tired using table but its not working. Please help me.
>
> Best,
> guru.
>

Navigate in group php.windows at sever news.php.net
Previous Next


Your recent visits
PHP Not working in Virtual Directory on IIS6.0
MySQL Configuration on Windows Box with Apache and PHP
Re: [PHP-WIN] MySQL Configuration on Windows Box with Apache and PHP
RE: [PHP-DB] Unable to connect to mysql database
GD install



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants