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 is design pattern? Explain all including singleton pattern?
Tell me how is it possible to return a value from a function?
What is the difference between $argv and $argc? Give example?
How to find length of an array in php ?
List some string function name in php?
Explain briefly about a search-friendly site looks like?
Explain about switch statement in PHP?
How do I use isdigit function?
What is the function of mysql_real_escape_string in php?
What is the major php security hole? How to avoid?
What is the output of the following php code?
Explain how can php and javascript interact?
What function should you use to join array elements with a glue string?
How to join multiple strings into a single string?
What is a php 5?