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
I am writing an application in php that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with php?
How do I make a reset button in html?
What are the php variables?
What is lazy loading in php?
What does the scope of variables mean?
What is the mysql injection?
Explain what is the difference between for and foreach?
What is the difference between runtime exception and compile time exception?
Difference between mysql_connect and mysql_pconnect?
What is strcmp?
What is a PHP Filter?
What is PHP? Who is the father or inventor of PHP?
What is the main difference between require() and include()?
How to create a text file in PHP?
What is the purpose of php?