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:

  • Hangman game code in Visual c#using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace hangman_csharp {     static class Program     {         /// <summary> &nb… Read More
  • HTML code to Design front Page of any hotel<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>KHYBERS G… Read More
  • PHP Code for Inserting Data<html> <head> <style type="text/css">     ul {     list-style: none;     margin: 0;     }     li {     float: left;     }     … Read More
  • CSS code for image slider/* For generic page styles. Not for sliders. */ body {background:#F6F6F6;font:normal 0.9em Arial; margin:0; padding:0; padding-bottom:60px;} h2 {display:inline;} .div1, .div2 {width:700px;margin:0 auto;} .div1 {margin-top:30… Read More
  • CSS code for image slider/* For generic page styles. Not for sliders. */ body {background:#F6F6F6;font:normal 0.9em Arial; margin:0; padding:0; padding-bottom:60px;} h2 {display:inline;} .div1, .div2 {width:700px;margin:0 auto;} .div1 {margin-top:30… Read More

0 comments:

Post a Comment