phpMyAdmin
 sql >> Database >  >> Database Tools >> phpMyAdmin

Come aggiornare i dati in un database SQL

Non ti darò il codice a meno che tu non dimostri come ha detto il commentatore precedente. Tuttavia, ti fornirò una panoramica in modo che tu possa lavorarci da solo.

update.php

Check if your is logged in.

if TRUE, continue.

get the new wage from the form

$new_wage = $_POST['new_wage'];

Be sure to validate and clean the $new_wage variable.

Next stage assumes your using PDO

$params = array($new_wage, $logged_in_user_id);

$update = "UPDATE user_registration SET wage=? WHERE user_id=?";

$pdo->prepare($update);
$pdo->execute($params);