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
Write a program to display reverse of any number?
Tell me how to set a page as a home page in a php based site?
What is substr() in php? And how it is used?
Is age an interval or ratio?
How do you pass a variable by value?
Tell me what library is used for pdf in php?
What are sql injections, how do you prevent them and what are the best practices?
How can image properties be retrieved in php?
How do you display the output directly to the browser?
What is php static function?
What is a class in php programing?
What is use of isset function in php?
What is is_null() in php?
What is the main difference between php 4 and php 5?
Explain type casting and type juggling.