Jump to content
Sign in to follow this  
Nuimi

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...