Jump to content

Submit Update to SQL DB


Jay2391

Recommended Posts

I cut off lot of the code fo simplicity but the main goal is to update an existing table

in whish i will update multiple fields at a one time with a post submition...

I get this error..

Cannot Update TableYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET win='', loss='', tie='', rank='', eliminated='', fi' at line 1


[code]

print "<form action=\"Slef" method=\"post\">";
print 'W: <input type="text" name="win_update" size"20" value="' . $_POST['win_update'] . '"/><br />';
print 'L: <input type="text" name="loss_update" size"10" value="' . $_POST['loss_update'] . '"/><br />'; 
print '<br><input type="submit" name="submit" size"20" value="Update Records"/><br /></h4>';
 
                     
$win_update = $_POST['win_update'];
                                                  $loss_update = $_POST['loss_update'];

$user_update = "UPDATE $tabletr SET win='$win_update', loss='$loss_update'           WHERE user_name='$chg_player'";   
                      mysql_query($user_update) or die ("Cannot Update Table". mysql_error());


?>

[/code]
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.