Jump to content

Recommended Posts

  ??? Okay, I'm stumped on this one which means that it's probably something really simple after going wrong and that I need a second pair of eyes. Any help would be great.

 

I have a table that was set up as follows:

 

mysql_query("CREATE TABLE letter_template(
               
		   template_id int(2) not null,
		   primary key(template_id),
		   template_type varchar(20),
		   lost_tender text,
		   won_tender text,
		   pending_tender text
		   
		   )") or die("Problem");
		   
mysql_query("INSERT INTO letter_template(
                
			template_id, template_type, lost_tender, won_tender, pending_tender)

		 VALUES(1, 'Regular', 'Default', 'Default', 'Default')") or die(mysql_error);

 

Now, that worked fine and all fields were filled. The problem is on my update page:

 

if(isset($_POST['update'])){

$won = mysql_real_escape_string($_POST['won_tender']);
$lost = mysql_real_escape_string($_POST['lost_tender']);
$pending = mysql_real_escape_string($_POST['pending_tender']);
var_dump($_POST);



mysql_query("UPDATE letter_template
             SET won_tender = '$won',
		 SET lost_tender = '$lost',
		 SET pending_tender = '$pending'
		 WHERE template_type = 'Regular'
		 ") or die("Problem");

mysql_close();
}

 

As you can, I've done a var dump, which turned up fine. The problem is with the actual query update.

Link to comment
https://forums.phpfreaks.com/topic/111653-solved-update-problem/
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.