Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title> Wheres the fucking title!!</title>
- </head>
- <body>
- <h4>DATA TABLE:</h4>
- <table border=1 cellspacing=0 cellpadding=5 style="border: 1px solid #ccc;" >
- <tr>
- <th>Name</th>
- <th>Age</th>
- <th>Eye Colour</th>
- <th>Height</th>
- <th>Weight</th>
- </tr>
- <?php
- $host = "localhost";
- $username = "phpdood";
- $password = "PopenHsesameP";
- $database = "kj_database2";
- mysql_connect($host,$username,$password);
- @mysql_select_db($database) or die("Unable to select database: ". mysql_error());
- $query = "SELECT * FROM kj_datatable2";
- $result = mysql_query($query);
- $num = mysql_numrows($result);
- $i=0;
- while ($i < $num) {
- $name=mysql_result($result,$i,"name");
- $age=mysql_result($result,$i,"age");
- $eye_colour=mysql_result($result,$i,"eye_colour");
- $height=mysql_result($result,$i,"height");
- $weight=mysql_result($result,$i,"weight");
- ?>
- <tr>
- <td><?php print "$name"; ?></td>
- <td><?php print "$age"; ?></td>
- <td><?php print "$eye_colour"; ?></td>
- <td><?php print "$height"; ?></td>
- <td><?php print "$weight"; ?></td>
- </tr>
- <?php
- $i++;
- }?>
- </table>
- <form method="post" action="insert.php" name="insert_form" >
- <table width="400px" >
- <tr><td>Name:</td><td><input type="text" name="name"> </td></tr>
- <tr><td>Age:</td><td><input type="text" name="age"></td></tr>
- <tr><td>Weight:</td><td><input type="text" name="weight"></td></tr>
- <tr><td>Eye Color:</td><td>
- <select name="eye_colour">
- <option value="blue" >Blue</option>
- <option value="brown" >Green</option>
- <option value="hazel" >Hazel</option>
- <option value="green" >Green</option>
- <option value="brown" >Brown</option>
- </select>
- </td></tr>
- <tr><td>Height:</td><td><input type="text" name="height"/></td></tr>
- <tr><td></td><td><input type="submit" /></td></tr>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement