Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Anchit Jindal

By: a guest on Oct 16th, 2009  |  syntax: PHP  |  size: 0.71 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>
clone this paste RAW Paste Data