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
Where session is stored?
What is return in php function?
List some sorting functions in php?
What is an abstract class in php?
What can php do?
Which operator is used to combine string values in php?
When you want to show some part of a text displayed on an html page in red font color? What different possibilities are there to do this? What are the advantages/disadvantages of these methods?
Do you know what does mvc stand for and what does each component do?
What is echo in html?
Explain what does the function get_magic_quotes_gpc() means?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what is the problem?
Explain the types of functions for Splitting String?
Is c similar to php?
Explain about the data types in PHP?
How to create a table to store files?