[Solved] This update query won’t update record

<?php if (isset($_GET[‘edit’])) { ?> <form action=”index.php” method=”post”> <input type=”text” name=”id” value=”<?=$id;?>”> <input type=”text” name=”nieuweprijs” placeholder=”vul nieuwe prijs in”> <input type=”submit” name=”submitnieuweprijs” value=”verzenden”><form> <?php } if (isset($_POST[‘submitnieuweprijs’])) { $nieuweprijs = Safesql($_POST[‘nieuweprijs’]); $id = Safesql($_GET[‘id’]); if(!$mysqli->query(“UPDATE prijzen SET prijs=””.$nieuweprijs.”” WHERE id='”.$id.”‘”)) { echo $mysqli->error;} Laden(0); } } ?> $id is the value obtained from the query … Read more

[Solved] Retrieve data from database and display in text boxes [closed]

I’ll give a very simple example that should get you started. The values are accessible via (most likely) $_POST[‘input_name’]. Without using Post/Redirect/Get, you can just get the input values like: $input_name = isset($_POST[‘input_name’]) ? $_POST[‘input_name’] : ”; Then later you’ll display it in the form like: echo ‘<input name=”input_name” value=”‘ . htmlspecialchars($input_name, ENT_QUOTES) . ‘”>’; … Read more

[Solved] PHP script to update mySQL database

Your sql is wrong. Apart from the gaping wide open SQL injection attack vulnerability, you’re generating bad sql. e.g. consider submitting “Fred” as the first name: $First_Name2 = “Fred”; $query = “UPDATE people SET Fred = First_name WHERE ….”; now you’re telling the db to update a field name “Fred” to the value in the … Read more

[Solved] Update PHP statement [closed]

you are not connecting to database. you variables are strings. change this $conn = mysql_connect(“$DB_HostName”, “$DB_User”, “$DB_Pass”) to $conn = mysql_connect($DB_HostName, $DB_User, $DB_Pass) and your update is wrong . you have to use math part outside the query, try use this $RH = $RANK * $HEALTH ; $SP = $Skills + $POWER ; $SPRH = … Read more