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
https://forums.phpfreaks.com/topic/36412-submit-update-to-sql-db/
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.