How to get tabels from database in php andd display it in
the table form using codelgniter?
plz help me
Answers were Sorted based on User's Feedback
Answer / 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 |
require "config.php"; //for connection with database
$query2=" SELECT * FROM tablename";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
$bgcolor="#f1f1f1";
echo "<TABLE width=50% align=center cellpadding=2
cellspacing=2> <tr>";
echo "<td bgcolor='dfdfdf' > <font
face='arial,verdana,helvetica'
color='#000000'>value1</font></td>";
echo "<td bgcolor='dfdfdf' > <font
face='arial,verdana,helvetica'
color='#000000'>value2</font></td>";
echo "<td bgcolor='dfdfdf' > <font
face='arial,verdana,helvetica'
color='#000000'>value3</font></td>";
echo "<td bgcolor='dfdfdf' > <font
face='arial,verdana,helvetica'
color='#000000'>value4</font></td>";
echo "<td bgcolor='dfdfdf'> <font
face='arial,verdana,helvetica'
color='#000000'>value5</font></td></tr>";
Is This Answer Correct ? | 4 Yes | 5 No |
What is the use of "echo" in php?
What is a comment in php?
Would you initialize your strings with single quotes or double quotes?
can you give me an example code of calling java script function in php variable using AJAX.or with out ajax??????
Is session a cookie?
What are the advantages of indexes?
how many ways we get current date in php
What is T_PAAMAYIM_NEKUDOTAYIM?
What is the w3c?
How to call php function in jquery?
How can we increase the execution time of a PHP script?
12 Answers CyberBeoz, Photon, XTX,
What is design pattern? Explain all including singleton pattern?