Jump to content

[SOLVED] Update problem


waynew

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.