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

What is the use of mysql_real_escape_string() function?

691


What is php compared to html?

721


How do functions work?

732


What is the difference between echo print and print_r in php?

739


What does the expression exception::__tostring means?

751


Explain the difference between static and dynamic websites?

731


What are the php functions?

737


What is the meaning of "enctype= multipart/form-data" ?

722


Explain me what is sql injection?

717


What does $_server mean?

736


What is the integer?

795


What is the default time of cookie in php?

700


How to download files from an external server with code in php?

685


Is null or empty c#?

697


How to get no of arguments passed to a PHP Function?

680