Hi!
I'm having problems updating database via a form.
Page displays as it should but nothing gets updated in the database.
What am I doing wrong?
<?php
require_once "../../maincore.php";
require_once THEMES."templates/header.php";
define("XXXX", DB_PREFIX."YYYY");
opentable("Save User");
if (isset($_POST['savecat'])) {
$Name = $_POST['Name'];
$Points = $_POST['Points'];
$result = dbquery("UPDATE ".XXXX." SET Points='$Points' WHERE Name='$Name'");
}
$formaction = FUSION_SELF;
echo "<form name='addcat' method='post' action='$formaction'>";
echo "<table width='100%' cellspacing='0' cellpadding='0' border='0' class='tbl'>
<tr><td width=140 valign=top>Name:</td><td></td><td><input type='text' align='left' name='Name' value='' class='textbox' style='width:200px;'><br><br></td></tr>
<tr><td width=140 valign=top>Points:</td><td></td><td><input type='text' align='left' name='Points' value='' class='textbox' style='width:200px;'><br><br></td></tr>
<tr><td valign=top><input type='submit' name='savecat' value='Save' class='button'></td>
</form>\n</tr>
</table>";
closetable();
require_once THEMES."templates/footer.php";
?>
Merged on Jun 16 2012 at 12:34:17:
Itīs only updating points if name is already in database.
If entering a non existing user nothing happens.
Edited by MarcusG on 16-06-2012 14:04
|