Jump to content

MySql Database Value Doesn't Update


nirjhor

Recommended Posts

I am writing a code for a page which will get certain information from database into fields  and update edited information.

I can get information from database, but cannot update the edited information to database.

Please, Can anyone help me ?

<?	session_start();
include("includes/connection.php");
include("includes/config.php");

$sqlsettings = "SELECT * from admin";
$resultsettings = mysql_query($sqlsettings);
$rowsettings = @mysql_fetch_array($resultsettings);

if ($_SESSION['MyAccount']=='')
{
	$_SESSION['MyAccount'] = "MyAccount";
	header('LOCATION: login.php');
	exit();
}
$msg='';
if($_POST['continue'] == "true")
{	
$AddedDate = $_POST['AddedDate'];
$sqlUpdate = "UPDATE buyer_career SET 
CareerTitle='".mysql_real_escape_string($_POST['CareerTitle'])."',
CareerDescription='".mysql_real_escape_string($_POST['CareerDescription'])."',
ExpiryDate='".mysql_real_escape_string($_POST['ExpiryDate'])."', where BuyerCareerID=".$_POST['BuyerCareerID'];

$result=mysql_query($sqlUpdate);				

header("Location:buyers_career.php?msg=Buying Lead has been updated successfully");			
	exit();
    }
?>

<?
   //retreiving data from selling leads
   $sqlBuyingLead="select * from buyer,buyer_career where buyer.BuyerID=buyer_career.BuyerID and BuyerCareerID=".$_GET['BuyerCareerID'];
   $resultBuyingLead=mysql_query($sqlBuyingLead);
   $buying_row=@mysql_fetch_array($resultBuyingLead);

?>
	    
<form name="PostNewCareer" method="post" action="edit_buyer_career.php" enctype="multipart/form-data" onSubmit="return validate(this);">

<input type="text" name="CareerTitle" style="width: 400px" class="basicPoint" id="CareerTitle" value="<?=$buying_row['CareerTitle']?>" /> 
<input type="hidden" name="AddedDate" value="<?=$buying_row['AddedDate']?>">

	       
<input type="text" name="CareerVacancies" style="width: 400px" class="basicPoint" id="CareerVacancies" value="<?=$buying_row['CareerVacancies']?>"/>	        


<input type="hidden" name="continue" value="true">
<input type="hidden" name="BuyerCareerID" id="BuyerCareerID" value="<?=$_GET['BuyerCareerID']?>"/>
<input type="submit" value="Update Buying Lead" name="submitButton" />


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.