0

I have in my table of mysql this cells: ebook_data and ebook_email. I want to update ebook_data if ebook_email is same, if not insert ebook_data and ebook_email.

I don't understand werry well php and mysql.

Can you help me, please?

Thanks in advance.

4
  • 3
    You're looking for something like this. Commented Aug 12, 2015 at 8:23
  • $sql="INSERT INTO ebook (ebook_data, ebook_email) VALUES (NOW(), '$ebook_email') ON DUPLICATE KEY UPDATE ebook_data =VALUES(NOW())"; Commented Aug 12, 2015 at 8:27
  • Don't comment your code and update it to your post. Commented Aug 12, 2015 at 8:30
  • @Andrew Flag this as a duplicate Commented Aug 12, 2015 at 8:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.