Friday, January 10, 2014

How To Connect To Data Base In PHP

 Sample Code
  


<html>
<body>
<h1> Registration Form</h1>
<table border="1">
<tr>
<th>Reg No</th>
<th>Name</th>
<th>F.Name</th>
<th>Email</th>
</tr>
<?php
mysql_connect("localhost","root","");
mysql_select_db("kiu");
$result=mysql_query("select * from student2");
while ($row =mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" .$row['Reg_no']."</td>";
echo "<td>" .$row['Name']."</td>";
echo "<td>" .$row['FName']."</td>";
echo "<td>" .$row['Email']."</td>";

echo "<tr>";
}
mysql_free_result($result);
mysql_close();
?>
</table>
</body>

</html>

Related Posts:

  • Master Page code in ASP.NET <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MainMaster.master.cs" Inherits="MainMaster" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transi… Read More
  • Php Code For Payment Process <?php session_start() ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>tameraplazainn</title> <link href="css/main.css" rel="stylesheet" type="text… Read More
  • PHP code To make Gallery <?php # SETTINGS $max_width = 100; $max_height = 100; function getPictureType($ext) { if ( preg_match('/jpg|jpeg/i', $ext) ) { return 'jpg'; } else if ( preg_match('/png/i', $ext) ) { return 'png'; } els… Read More
  • Php And Html Code For Admin Home Page <?php require_once('auth.php'); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script src="js/jquery-1.2.1.pack.js" t… Read More
  • PHP code To cancelle any Booking IN Hotel <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- .view{ overflow: auto; float:right; width: 680… Read More

0 comments:

Post a Comment