Jump to content

SQL - Update


Recommended Posts

Can you help me with sql, I need update form, but I don´t know how can I do it.

       $db= new mysqli("localhost", "dany66", "*******", "mathstart");       $email_n = $_POST['email_n'];       $vek_n = $_POST['vek_n'];       $datum_n = $_POST['datum_n'];       if(isset($email_n))       {        $update1 = "UPDATE inf(email) SET  email= '$email'                     WHERE jmeno = '" . $_SESSION['username'] . "'";        $pokus = $db -> query($update1);        if(fetch_assoc($pokus) == TRUE)        {         echo("<script> alert('Řádek s e-mailem byl změněn.')</script>");        }        }
Edited by Nuimi
Link to comment
Share on other sites

I think the error might be in the name of the table. Change inf(email) for the name of the table (usually is 'users') and it should work.


In case that you actually called you db inf(email): Sorry, my bad!

Edited by Stemar
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...