How to get tabels from database in php andd display it in
the table form using codelgniter?
plz help me
Answer Posted / vivek soni
//HTML coding
<html>
<head>
<title>Table</title>
</head>
<body>
<div><?php include("table.php");?></div>
</body>
</html>
//include table.php contain....
<?php
include("inc_connection.php");
$sql="select * from tablename";
$rs=mysql_query($sql);
echo "<table border=1 width='100%'> ";
echo "<tr><td colspan='2' align='center'>Student
Name</td><td >phone No</td></tr>";
while($row=mysql_fetch_assoc($rs))
{
echo "<tr><td align='right'>".$row['fname']."</td><td
align='left'>".$row['lname']."</td><td>".$row['phn']."</td></tr>";
}
echo "</table>";
?>
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are different types of runtime errors in php?
How to get a random value from a php array?
Why do we need session?
What is a PHP Filter?
Tell me what are magic methods?
Where php language is used?
How to merge values of two arrays into a single array?
Why do we use inheritance in php?
How to submit form without a submit button.
What is Mcrypt used for?
How to read and display a HTML source from the website url?
how to use http headers inside php? Write the statement through which it can be added?
What are the characteristics of php?
What are the differences between php constants and variables?
Explain object-oriented methodology in php?