Advertisement
booruguru

updatelink.php

Dec 31st, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.93 KB | None | 0 0
  1.     <?php
  2. $dbhost = "localhost"; // this will ususally be 'localhost', but can sometimes differ
  3. $dbname = "database"; // the name of the database that you are going to use for this project
  4. $dbuser = "root"; // the username that you created, or were given, to access your database
  5. $dbpass = "root"; // the password that you created, or were given, to access your database
  6.  
  7. mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());
  8. mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());
  9.  
  10. $ud_ID = $_REQUEST["ID"];
  11. $ud_linktitle = $_POST["ud_linktitle"];
  12. $ud_linkid = $_POST["ud_linkid"];
  13. $ud_linkowner = $_POST["ud_linkowner"];
  14.  
  15.  
  16.  
  17.  
  18. $query = "UPDATE Klipbook_Links SET Link_ID = '$ud_linkid', Link_Title = '$ud_linktitle', Link_Owner_ID = '$ud_linkowner' WHERE Link_ID = '$ud_ID'";
  19.  
  20. $res = mysql_query($query);
  21.  
  22. if ($res)
  23.   echo "<p>Record Updated<p>";
  24.  
  25. else
  26.   echo "Problem updating record. MySQL Error: " . mysql_error();
  27.  
  28. ?>    <?php
  29. $dbhost = "localhost"; // this will ususally be 'localhost', but can sometimes differ
  30. $dbname = "database"; // the name of the database that you are going to use for this project
  31. $dbuser = "root"; // the username that you created, or were given, to access your database
  32. $dbpass = "root"; // the password that you created, or were given, to access your database
  33.  
  34. mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());
  35. mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());
  36.  
  37. $ud_ID = $_REQUEST["ID"];
  38. $ud_linktitle = $_POST["ud_linktitle"];
  39. $ud_linkid = $_POST["ud_linkid"];
  40. $ud_linkowner = $_POST["ud_linkowner"];
  41.  
  42.  
  43.  
  44.  
  45. $query = "UPDATE Klipbook_Links SET Link_ID = '$ud_linkid', Link_Title = '$ud_linktitle', Link_Owner_ID = '$ud_linkowner' WHERE Link_ID = '$ud_ID'";
  46.  
  47. $res = mysql_query($query);
  48.  
  49. if ($res)
  50.   echo "<p>Record Updated<p>";
  51.  
  52. else
  53.   echo "Problem updating record. MySQL Error: " . mysql_error();
  54.  
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement