Advertisement
Guest User

Untitled

a guest
Feb 1st, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1.  
  2.  
  3. <html>
  4.  
  5. <body>
  6.  
  7.  
  8.  
  9.  
  10.  
  11. <?php
  12.  
  13. $con = mysql_connect("mysql2.000webhost.com","a6620699_oils","*****");
  14.  
  15. if (!$con)
  16.  
  17.   {
  18.  
  19.   die('Could not connect: ' . mysql_error());
  20.  
  21.   }
  22.  
  23.  
  24.  
  25. mysql_select_db("a6620699_oils", $con);
  26.  
  27.  
  28.  
  29. $sql="INSERT INTO Posts (Show, Picture, Name, Date, Poster, Text) VALUES('$_POST[Show]','$_POST[Picture]','$_POST[Name]','$_POST[Date]','$_POST[Poster]','$_POST[Text]')";
  30.  
  31.  
  32.  
  33. if (!mysql_query($sql,$con))
  34.  
  35.   {
  36.  
  37.   die('Error: ' . mysql_error());
  38.  
  39.   }
  40.  
  41. echo "1 record added";
  42.  
  43.  
  44.  
  45. mysql_close($con)
  46.  
  47. ?>
  48.  
  49. </body>
  50.  
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement