Location: PHPKode > projects > Decider > decider/Key_Person/editkp.php
<?php
$user = "root";
 $pass = "";
 $db = "deciderdb";
 $link = mysql_connect( "localhost", $user, $pass );
 if ( ! $link ) {
   die( "Couldn't connect to MySQL: ".mysql_error() ); }


 //require("../common/database.php");
 //if ( ! $link ) {
   //die( "Couldn't connect to MySQL: ".mysql_error() ); }

mysql_select_db( $db, $link )
  or die ( "Couldn't open $db: ".mysql_error() );




if (isset($_GET['k_id']) && isset($_GET['newkp'] )) {
	//Add slashes to any quotes to avoid SQL problems.
	echo "php called";
	$k_id = addslashes($_GET['k_id']);
	$newkp= addslashes($_GET['newkp']);
	//Get every page title for the site.
	$query="UPDATE key_person SET Name='".$newkp."' where Id='".$k_id."'";
	//$result = mysql_query("SELECT * FROM key_person WHERE Domain_Name='".$domain."'");
	if (!mysql_query($query,$link))
	  {
	  die('Error: ' . mysql_error());
	  }
	echo "1 record edited";
	
	mysql_close($link);
	
	
}
	
	

?>
Return current item: Decider