2013-09-26 88 views
0

我使用這個代碼,我想就這些領域沒有空,如果任何字段爲空,則無法從我的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)"; 

回答

0

你大概就是這個意思這樣的事情:

$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"; 

我不知道寫這個聲明的更短的方法。