Advertisement
Guest User

Anchit Jindal

a guest
Oct 16th, 2009
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. $status=mysql_connect('localhost','root','');
  4. if(!$status)
  5. {
  6.   echo "Unable to connect";
  7. }
  8. else
  9. {
  10.   echo "Successfully connected";
  11. }
  12.  
  13. mysql_select_db("project",$status);
  14.  
  15.  
  16.  
  17. $insrt="INSERT INTO stuinfo VALUES
  18. ('$_POST[name]','$_POST[fname]','$_POST[address]','$_POST[dob]','$_POST[Course]','$_POST[Branch]','$_POST[batch]','$_POST[rno]','$_POST[reg]','$_POST[gender]')";
  19. mysql_query($insrt,$status);
  20. $selct="SELECT * FROM stuinfo";
  21.  
  22. $result=mysql_query($selct);
  23. while($row = mysql_fetch_array($result))
  24. {
  25. echo $row['Name'],$row['Fathersname'],$row['Address'],$row['DOB'],$row['Course'],$row['Branch'],$row['Batch'],$row['RollNo'],$row['UnivRegNo'],$row['Gender'];
  26. echo "<br />";
  27. }
  28.  
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement