0

Maybe someone can help me figuring out on how to insert a html img tag into my database table. I've done tons of research but nothing is working.

For example:
My sql query below the "content" column in my table I want to be able to place a <img src=''> html tag for the value.

$sql = "INSERT INTO custom_slideshow (username, slideshow_name, name, content, cssanimate) VALUES ('admin', 'sample', 'a', 'HTML_CODE_HERE', 'fade')";

I'm obviously getting a SQL syntax error though. Is something like this possible?

code
  • 1,041
  • 1
  • 12
  • 28
  • 2
    why don't you just store the url and then in php use your variable inside an img src tag ?Altough you should be able to store this in your database. You are probably not passing a string. – Unex Oct 27 '17 at 15:22
  • 4
    Parameterize the query and it will work. – chris85 Oct 27 '17 at 15:23
  • Sorry guys... i'm such an idiot! So easy! Both of those ideas worked. It's been a long night. I stayed up ordering the iPhone X. Tired haha. – code Oct 27 '17 at 15:30

0 Answers0