0

I am using this code, I want to just those field there is no empty if any fields is empty then not open the image from my sql server,

$Query = "SELECT * FROM movie_post WHERE id=$id AND NOT IS NULL(linkfrom2,m_link2,linkfrom3,m_link3,linkfrom4,m_link4,linkfrom5,m_link5)";
BenMorel
  • 34,448
  • 50
  • 182
  • 322

1 Answers1

0

You probably mean something like this:

$query = "SELECT * FROM movie_post WHERE id=$id AND linkfrom2 IS NOT NULL AND  m_link2 IS NOT NULL AND linkfrom3 IS NOT NULL AND m_link3 IS NOT NULL AND linkfrom4 IS NOT NULL AND m_link4 IS NOT NULL AND linkfrom5 IS NOT NULL AND m_link5 IS NOT NULL";

I do not know a shorter way to write this statement.

seven77
  • 380
  • 1
  • 4