Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



How to get tabels from database in php andd display it in the table form using codelgniter? plz he..

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

How to get tabels from database in php andd display it in the table form using codelgniter? plz he..

Answer / amit srivastava

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' >&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value1</font></td>";
echo "<td bgcolor='dfdfdf' >&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value2</font></td>";
echo "<td bgcolor='dfdfdf' >&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value3</font></td>";
echo "<td bgcolor='dfdfdf' >&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value4</font></td>";
echo "<td bgcolor='dfdfdf'>&nbsp;<font
face='arial,verdana,helvetica'
color='#000000'>value5</font></td></tr>";

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More PHP Interview Questions

How do I display php errors?

0 Answers  


How to strip whitespace (or other characters) from the beginning and end of a string?

0 Answers  


How can you pass a variable by reference?

0 Answers  


What is the different between cookies and session in php?

13 Answers  


how set session expire time in php?

4 Answers  


What is regex in html?

0 Answers  


What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?

0 Answers  


What is php session_start() and session_destroy() function?

0 Answers  


Which is the correct way to check if a session has already been started ?

0 Answers  


How to access a specific character in a string using php?

0 Answers  


how many types of inheritance is there in php? name there?

10 Answers  


Tell me how to strip whitespace (or other characters) from the beginning and end of a string?

0 Answers  


Categories