How to get tabels from database in php andd display it in
the table form using codelgniter?
plz help me

Answer Posted / amit srivastava

require "config.php"; //for connection with database
$query2=" SELECT * FROM tablename";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
$bgcolor="#f1f1f1";
echo "<TABLE width=50% align=center cellpadding=2
cellspacing=2> <tr>";
echo "<td bgcolor='dfdfdf' >&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value1</font></td>";
echo "<td bgcolor='dfdfdf' >&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value2</font></td>";
echo "<td bgcolor='dfdfdf' >&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value3</font></td>";
echo "<td bgcolor='dfdfdf' >&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value4</font></td>";
echo "<td bgcolor='dfdfdf'>&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value5</font></td></tr>";

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List some of the features of php7.

770


Where are sessions stored php?

775


Why laravel is best php framework?

752


Where php language is used?

733


How to support multiple-page forms?

764


What is a null coalescing operator in php7?

926


How does the identity operator === compare two values?

887


How to turn on the session support in php?

719


What does the unset() function means?

821


What is the purpose of the php empty function?

713


How to move uploaded files to permanent directory?

720


How can we know the total number of elements of Array?

810


What are the common uses of php?

780


Does php support multiple inheritances?

761


What is an operator in php?

801